Subject:JAVA and XML Author:praveen ap Date:10 Nov 2008 06:22 AM
I have a really big XML to handle (around 5000 lines).
Basically I need to read it and pass the data to UI.
It has a lot of tags and most of them have attributes.
The problem is I need to pass tag names, attribute names etc... to get the data.
If it were a small XML, i could have done it by passing the tag names and attributes names.
Now, I want to know if i can just do something like get the root tag , get its name, check if it has children, if yes then get the tag names and text. Check if the tags have attributes. If yes, get their name and values, and so on. I can then put the tag names, tag values , attribute names, attribute values and the text values in a collection class along with the tags heirarchy wrt the root tag(0 for root, 1 for root's children, 2 for its grandchildren...) and pass it to the UI.