How to get only simple tag elements in the XML

Mar 3, 2009
Reaction score
Hi all,

i have a xml file


i need to get the simple tag names(here it is name,price,aname,city) in to a list i have heard about SAX parser event driven it walks throgh the xml step by step when a new tag occurs it will parse etc....

but i am unable to get the only sampletag names into a Arraylist

i have heard about a method getElementBytagName()

i dont want to write a code for particular xml because later on i have to retrive same simple tags from another xml say employee.xml

please provide a generic code which will retrive the simple tag names and stores into a Arraylist

the real xml i want to store only simple elements into array list

we are testers ,we have general idea about list, sax ,,,sample java programs ,please dont put this post in low priority please provide a links or sample programs,

the reason we are collecting only the simple tag names is the same names will be column names in DB but not the complex tag names .
we need to verify the response what we got is weather from DB or NOt,,


<!--1 or more repetitions:-->


Last edited:


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question