RE: [xml] How to stop SAX parsing ?

Date view Thread view Subject view Author view

From: Eric Bresie (ebresie@usa.net)
Date: Tue Jun 27 2000 - 18:29:34 EDT


I am really more of a lurker on this list and on the perl-xml list,
but this thread made me wonder if the current SAX support (is it SAX1 or
SAX2),
has the Error Events and the Error Event Handler capabilities?

I am using as a reference (which may not be the same in libxml case):

http://bitsko.slc.ut.us/~ken/perl-xml/sax-2.0-adv.html#Handlers see Error
Events

or in the original SAX2/Java setEventHandler.

http://www.megginson.com/SAX/Java/index.html

Eric Bresie
ebresie@usa.net

> -----Original Message-----
> From: xml-request@rufus.w3.org [mailto:xml-request@rufus.w3.org]On
> Behalf Of Daniel Veillard
> Sent: Monday, June 26, 2000 9:58 AM
> To: xml@rpmfind.net
> Subject: Re: [xml] How to stop SAX parsing ?
>
>
>
> On Mon, Jun 26, 2000 at 04:37:12PM +0200, Petr Kozelka wrote:
> >
> > I am implementing a SAX parser which invokes some external
> applications or commands.
> > When the command fails, I need the parser to stop parsing and
> ignore the rest of the file.
> > How can I do this ? Is there a SAX function which I can call
> from inside of my SAX handler to stop sending SAX events ?
>
> Hum, not yet ...
> The simplest to implement this would not be to add a new SAX
> callback but rather modify the xmlParserCtxtPtr passed to the
> callbacks. The best seems to be:
> - set ctxt->instate to XML_PARSER_EOF
> - hack xmlCurrentChar() to return 0
> if (ctxt->instate == XML_PARSER_EOF)
> Doing both should led to a quick termination of parsing
> (but endElement(s)/endDocument will certainly be called anyway).
>
> Daniel
>
> --
> Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes | Today's Bookmarks :
> Tel : +33 476 615 257 | 655, avenue de l'Europe | Linux XML libxml WWW
> Fax : +33 476 615 207 | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
> http://www.w3.org/People/all#veillard%40w3.org | RPM badminton Kaffe
> ----
> Message from the list xml@xmlsoft.org
> Archived at : http://xmlsoft.org/messages/
> to unsubscribe: echo "unsubscribe xml" | mail majordomo@xmlsoft.org

----
Message from the list xml@xmlsoft.org
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:16 EDT