Obtaining a sub tag of a main tag

Hi,Can anybody say me hw can we obtain a main tag in the xml file and can obtain the sub tag of the main tag.<main><sub> .... blah...blah..</sub></main>how can i get the sub from main.Thank you
[280 byte] By [Reply_mea] at [2007-11-26 21:02:52]
# 1

You need an XML parser. There are several APIs that you can use to parse an XML document. StAX may be the easiest one to get you going, but it's only in JDK 6.0/JAXP 1.4. Here is a link to the reader class:

http://java.sun.com/javase/6/docs/api/javax/xml/stream/XMLStreamReader.html

Otherwise, search for documentation on SAX or DOM. Hope this helps.

spericasa at 2007-7-10 2:35:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...