You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Jose Luis <jo...@yahoo.es> on 2008/01/17 11:57:34 UTC

Stop a SAX2 parser


Hi,

I am using a SAX2 parser to parse a very long XML file. I am using a
DefaultHandler derived class to get the information. How can I stop the
parser in a order way when I have found the needed information?

Thanks in advance,
Jose Luis
-- 
View this message in context: http://www.nabble.com/Stop-a-SAX2-parser-tp14916420p14916420.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.


Re: Stop a SAX2 parser

Posted by Alberto Massari <am...@datadirect.com>.
Hi Jose,
just throw a user-defined exception from within the handler; once you 
catch it in the function that invoked parse() you know the data has been 
collected.

Alberto

Jose Luis wrote:
> Hi,
>
> I am using a SAX2 parser to parse a very long XML file. I am using a
> DefaultHandler derived class to get the information. How can I stop the
> parser in a order way when I have found the needed information?
>
> Thanks in advance,
> Jose Luis
>