[XML-SIG] How to stop parser

Alexandre Alexandre.Fayolle@logilab.fr
Tue, 10 Dec 2002 15:30:40 +0100

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. 

Alexandre Fayolle
LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
Développement logiciel avancé - Intelligence Artificielle - Formations