Re: [xml] RE: xmlSetGenericErrorFunc

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Fri Nov 24 2000 - 18:58:41 EST


On Sun, Nov 19, 2000 at 10:33:01PM -0000, Leo Davidson wrote:
>
> To follow-up on this, two more things:
>
> 1) When I said you could call
> xmlSetGenericErrorFunc(stderr, xmlGenericErrorDefaultFunc)
> I was wrong since xmlGenericErrorDefaultFunc isn't available outside of
> LibXml's error.c, so as far as I can tell (maybe I'm being stupid!) there's
> no way to restore the default error handling, FWIW.

  xmlSetGenericErrorFunc is exported by xmlerror.h, at least in 2.2.8 ...

> 2) The error handler set by xmlSetGenericErrorFunc doesn't seem to get
> called very predicably... The documentation says it's called outside of
> parsing and validation, but it seems to be called during parsing as well,
> although not for as many events.

  the SAX error handler is by default xmlParserError which calls
the current generic error function.

> For example...
>
> Without changing the error handler I get error messages like this when
> calling xmlParseFile on a file which has an error:
>
> --8<--
> C:\SN_Devices.xml:5: error: error parsing attribute name
> <DigitsToPadTo Number="1"/>
> ^
> -->8--
>
> If I set an error handler, that handler only gets part of the error message:
>
> --8<--
> C:\Leo\source\Home\SuperNudelist\Debug\SN_Config\SN_Devices.xml:5: error:
> <DigitsToPadTo Number="1"/>
> ^
> -->8--
>
> (Missing the " error parsing attribute name<return>")
>
> Is this a bug?

  I have looked at this and could not find the error. Something else
must hae been changed, the error function always use the callback the
same way be it the default one or an overriden one ...

Daniel

-- 
Daniel.Veillard@w3.org | W3C  MIT/LCS  NE43-344  | Today's Bookmarks :
Tel : +1 617 253 5884  | 545 Technology Square   | Linux, WWW, Java,
Fax : +1 617 258 5999  | Cambridge, MA 02139 USA | badminton, Kaffe,
http://www.w3.org/People/W3Cpeople.html#Veillard | HTTP-NG and Amaya.
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Nov 24 2000 - 19:44:02 EST