Posted By

javadude on 12/24/09


Tagged

xml groovy


Versions (?)

Create simple XML with MarkupBuilder


 / Published in: Groovy
 

  1. def fw = new FileWriter("/somepath/persons.xml" )
  2. // to write to standard out, remove fw
  3. def xml = new groovy.xml.MarkupBuilder(fw)
  4.  
  5. xml.content() {
  6. xml.parameter(x:0)
  7. xml.person(id:100){
  8. firstname("John")
  9. lastname("Long")
  10. }
  11. xml.person(id:101){
  12. firstname("Ken")
  13. lastname("Smith")
  14. }
  15. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: javadude on October 18, 2010

just a test comment

Posted By: javadude on October 18, 2010

a second comment

You need to login to post a comment.