Parsing XML with Child Elements Validation

Viewed 25

I have the following example xml

<sub-flow name="TestSub_Flow" doc:id="20503297">
    <logger level="INFO" doc:name="Logger" doc:id="e92adc00" message="#[payload]"/>
    <annotations name="sampleName" />
</sub-flow>

I want to check if there is any annotation tag inside the 'sub-flow' tag using java. I have tried this using SAX but it seems to be a bit complicated. Which parser should I use to overcome this issue?

Basically I want to search this tag between the start and end of 'sub-flow'. Any solution is also welcome.

0 Answers
Related