Question

I have an xml file (potentially large) which I would like to process and update with the derived information. I would like to use staxmate to do this if possible. I have found documentation on reading and writing http://wiki.fasterxml.com/StaxMateTutorial ...but little on round-tripping (i.e. doing both).

I suspect the following will play a part in this... http://woodstox.codehaus.org/3.2.6/javadoc/org/codehaus/stax2/XMLInputFactory2.html#configureForRoundTripping%28%29

What I was expecting to find is a function which when passed an SMHierarchicCursor would write it and its children to an SMOutputContainer (or something similar to that).

In particular I would like to use Staxmate to do something like... How to modify a huge XML file by StAX?

Was it helpful?

Solution

There is no coupling between input- and output side in StaxMate, although you could still use underlying copy method on XMLStreamWriter2 (copyCurrentEvent or something like that), given input XMLStreamReader2 instance. But since cursors will skip what appears to be ignorable content, it may not work well for specific use case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top