Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating XML - how to convert an arraylist back to a node

 
John Dowling
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See code below; when i parse xmlInput on line 2 an arraylist appears to be returned for program. How do i convert this back to a node suitable for XmlNodePrinter? Can this be done with MarkupBuilder? Thanks


def xmlInput = parser.parse (new FileInputStream(INPUT_XML))
def program = xmlInput["md:programs"]["md:program"]

writer = new StringWriter()
new XmlNodePrinter(new PrintWriter(writer)).print(program)
println (writer.toString())
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic