[Expat-discuss] Abort parsing from inside an handler?

Régis St-Gelais regis.st-gelais at laubrass.com
Tue Oct 28 17:33:40 EST 2003


Hi,

Let say I'm inside the elementstart handler and I detect something wrong in
the file format.
I want to stop the parsing process.

Right now I do the following:

In my userdata structure I have:
bool bolError

In my elementstart handler, if I detect an error, I set bolError to true.

In my main loop, after the XML_Parse call, I check the bolError flag and I
stop the parsing if necessary.

It work not so bad but the parsing does not stop immediately when I catch
the error but when the current buffer sent to XML_Parse in completely
parsed.

So my question is: is there a way to abort the parsing from inside an
handler?

( I use expat 1.95.7)

Thanks

Regis





More information about the Expat-discuss mailing list