I'm parsing an XML file with SAX and at some point I need the inner XML of an element. E.g., for the following XML
<a name="abc">
<b>def</b>
<a>
I need to get the inner XML for the element a, which would be
<b>def<b>
What's the easiest way to do that?
Thanks.
Ivan
For this type of situation I suggest using 2 content handlers. The first is responsible for finding the relevant part of the document, and the second for processing the content. My answer to a similar question (see link below) demonstrates how to implement this approach:
- Using SAX to parse common XML elements