MarkupBuilder using list

Posted by tathamr on Stack Overflow See other posts from Stack Overflow or by tathamr
Published on 2009-06-15T16:18:25Z Indexed on 2010/03/15 6:09 UTC
Read the original article Hit count: 329

Filed under:
|

I am currently using sql.row("statement") and storing to a list. I then am trying to setup my xml file using MarkupBuilder. Is there a better way than iterating over the list poping off an item and then parsing it to add my different column names and values?

What is stored by list entry is

ID='X' Period='Yearly' Lengh='test'

So the XML would be something similar to:

<table name='test'>
 <row>
  <column name=ID>X</column>
  <column name=Period>Yearly</column>
  <column name=Length>test</column>
 </row>
</table>

© Stack Overflow or respective owner

Related posts about groovy

Related posts about Xml