[xml] stopping parsing

Hi all,

What's the best way of stopping the parser from the SAX interface?

My situation is this:  I'm doing 'partial' parsing of a document which
involves stopping when a certain element is reached and not doing any
more processing.  My initial solution was to NULL out all of my
callbacks in the SAX handler so that the parser runs through to the end
without my code receiving any more events.  This seems to work, but it
would be nice to be able to stop the parser in its tracks rather than
letting it finish the document.

I looked at xmlStopParser, but I will tend to call this when I hit a
start element, and the parser will give me errors back saying that it
hit the end of the data before seeing the end element.

Thanks in advance,


Graham Bennett

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]