xml parsing help

C

Christoff Pale

Hi,
This is about xml parsing.
I have been able to parse out
simple tags such as
<name>"John Doe</name>
by using

startElement()
characters()
endElement()

however how do I get nested fields?
for example
<books>
<booktype type="fiction">Catcher in the Rye</booktype>
</books>

in the above case I would like to parse out "Catcher in the Rye"

thanks
 
G

Guest

Hi,
This is about xml parsing.
I have been able to parse out
simple tags such as
<name>"John Doe</name>
by using

startElement()
characters()
endElement()

however how do I get nested fields?
for example
<books>
<booktype type="fiction">Catcher in the Rye</booktype>
</books>

in the above case I would like to parse out "Catcher in the Rye"

thanks

startElement is called for every element (including nested ones). You may
want to keep a Stack of tags and/or Book objects you are currently working
with.

HTH,
La'ie Techie
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top