Help with SAX parsing

U

uestebanez

Hi everybody!
I have a little problem working with libxml SAX API.
The problem is that I don't know how to stop parsing when I have
processed the data I need. I don't want to parse all file, I only need
read until I reach certain part of the xml and then stop parsing.
Does anybody know how to stop?

Another question is, Is necessary free any memory when I am using SAX
API?
I only call to "xmlSAXUserParseFile" and then callbacks "call me" so I
store the values in my own data structures and I never release
"nothing". Is this right?

Thanks to all.

PS: I would be very nice if some of you can tell me a good SAX API
tutorial.
 
M

Martin Honnen

I have a little problem working with libxml SAX API.
The problem is that I don't know how to stop parsing when I have
processed the data I need. I don't want to parse all file, I only need
read until I reach certain part of the xml and then stop parsing.
Does anybody know how to stop?

I don't know about libxml and C but with SAX2 in Java your handlers need
to throw an error to force the parser to abort parsing.
 
U

uestebanez

Thanks Martin,
But I'm afraid that exceptions doesn't exists in C (not C++) and this
is the languague tha I'm using. :-(
Regards,
Unai
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top