i have following xml file:
<package>
<reader>
<id>r1007</id>
<name>Robert</name>
<email>robert@yahoo.com</email>
</reader>
<writer>
<id>w1920</id>
<name>Young</name>
<email>young@hotmail.com</email>
</writer>
</package>
both ‘reader’ and ‘writer’ have fields as ‘id’, ‘name’ and ’email’, how can i differentiate them using SAXParser since SAXParser only tell ‘startElement’ and ‘endElement’. thanks.
You have to keep a stack of the parents of the element you are in.