This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

John Dowling
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