aspose file tools*
The moose likes Groovy and the fly likes Updating XML - how to convert an arraylist back to a node Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Updating XML - how to convert an arraylist back to a node" Watch "Updating XML - how to convert an arraylist back to a node" New topic
Author

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

John Dowling
Greenhorn

Joined: Dec 09, 2009
Posts: 2
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())
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updating XML - how to convert an arraylist back to a node
 
Similar Threads
override the equals and hashcode
print a HashSet of objects
Turn this Java into Groovy!
Node to int??
How to write XML to a new file.