I am processing XML processing with groovy. In particular, I draw in an XML file through XMLParser, doing a whole batch of processing in memory, and then serializing the data back into XML via MarkupBuiler.
The vast majority of the data in the file is transferred to a hierarchy of non-xml objects to talk to gui and perform processing, so the two XML files never know about each other.
However, there is one XML pool that lives on the edge of the source file, which must be copied verbatim to the XML output file with little or no processing. Is there a way to pass the MarkupBuilder a Node Listener from XMLParser and just paste it into the document?
Something like that:
def builder = new MarkupBuilder()
builder.outermosttag( name: 'library') {
someothertag( name: 'shelf' ) {
//magically insert a nodelist of arbitrary XML from somewhere else
}
}