Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsMOXy: Insert/Replacement scenario using Xpath
https://www.eclipse.org/forums/index.php/mv/msg/490015/1067164/#msg_1067164
I would like to modify the xml structure by inserting additional elements anywhere in the original structure, or replace an element with other content.
Can I somehow achieve that using EclipseLink MOXy? E.g. I want to to replace "some" by "someReplacement" and add "whatever".
The actual XML I want to process is more complex, however I only actually deal with a small subset of its content, so I would prefer not to unmarshall the complete file into a complex bean structure, make changes to a small set of elements, and marshall the whole structure back into a file. At least I don't want to know about the complexity.
This is because the input XML schema can vary greatly, but the specific elements I care about exist in each of these schema. So I would ideally want to find a solution to e.g. adapt XPaths in something like a bindings file to point to the elements I want to replace/insert.
I would prefer not to use JDOM, because the elements I produce for insertion/replacement are complex and I don't want to create them 'by hand' but instead have some bean structure be mapped.
Can I do this with MOXy? Any other JAXB provider? Should I use JDOM, or is there anything else that could help?]]>Tim Braun2013-07-07T00:43:35-00:00