I have some trouble understanding parsing XML structures with SAX. Let's say there is the following XML:
<root>
<element1>Value1</element1>
<element2>Value2</element2>
</root>
and a String variable myString
.
Just going through with the methods startElement, endElement() and characters() is easy. But I don't understand how I can achieve the following:
If the current element equals element1
store its value value1
in myString
. As far as I understand there is nothing like:
if (qName.equals("element1")) myString = qName.getValue();
Guess I'm just thinking too complicated :-)
Robert