[XML-SIG] How to stop parser

Remy C. Cool dev-xml@smartology.nl
Tue, 10 Dec 2002 15:55:23 +0100


On Tuesday 10 December 2002 15:30, Alexandre wrote:
> On Tue, Dec 10, 2002 at 02:34:44PM +0100, Remy C. Cool wrote:
> > My xmlproc parser checks if files mentioned in an xml file exists
> > on the system ... when the files are not present, an error is
> > written to the error handler. So far so good, but I want the
> > parser to stop parsing and return without raising an error so
> > that the program exits. Using return just returns the current
> > function is it not ?
>
> The right way to do that is to raise a SAXException in your
> ErrorHandler callback. This will cause the parser to call
> endDocument and to return.

Thanks, but how can I do that.

Warnings, errors and fatalErrors are handled by my own defined 
functions in the parser. They append the warning/error to a list 
which can be read by the main program when the parser returns.  How 
can I raise an SAXException so that the parser will return without 
halting the program ?