[xml] stopping parsing
- From: Graham Bennett <graham-libxml simulcra org>
- To: xml gnome org
- Subject: [xml] stopping parsing
- Date: Thu, 30 Oct 2003 22:50:19 +0000
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,
] [Thread Prev