I need a hint regarding a quick finding of specific nodes within the XML and removing the entire parent node (with children) if some of the values don't match the input parameters.
Example, having the XML as shown below:
<someparent attr="123" filters="+F1">
<filter id="F1">
<width>
<paper size="a4" val="10" />
<paper size="a3" val="12" />
</width>
<height>
<paper size="a4" val="10" />
<paper size="a3" val="12" />
</height>
</filter>
</someparent>
I should apply some rules:
However, I think that may be irrelevant at this point. The most important is quickly finding the filter nodes and removing parent nodes if needed.
Extra notes:
My plan is to create some prototypes, however... I'd appreciate any hints that may help me.
EDIT:// Sorry for late reply on that. So I've ended with StAX - it's rapid and works perfectly for me. Thank you all involved.
In general the different built-in parsers are SAX, StAX and DOM (https://rdayala.wordpress.com/dom-vs-sax-parsers/).
You could also try using XSLT, but the built-in one isn't necessarily the most high performing and you may need to pay for a premium one or to use all its features (streamed processing):
https://docs.oracle.com/javase/tutorial/jaxp/xslt/transformingXML.html