File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Register / Login
JavaRanch » Java Forums » Other Languages » Groovy
Reply 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())
 
 
subject: Updating XML - how to convert an arraylist back to a node
 
Threads others viewed
Turn this Java into Groovy!
print a HashSet of objects
Node to int??
override the equals and hashcode
How to write XML to a new file.
IntelliJ Java IDE