Re: [xml] Beta release of 2.6.0beta2



On Fri, Sep 26, 2003 at 12:53:32PM +0200, Stephane Bidoul wrote:
On Fri, Sep 26, 2003 at 11:34:37AM +0200, Stephane Bidoul wrote:
IMHO, the per context callbacks are fine.
The per thread callback for global errors can cause
problems when a library (or  python module for instance)
is using libxml. Indeed when that library wants to catch
global errors, it must register it's own handler, therefore
overriding handlers that may haven been set by the main
application or other libraries.

  A lot of errors can occur outside of the context of parsing a
resource too. How do you handle them then ?

That's my point: the callbacks mechanism is fine
(and necessary) when you have a parser context,
but I think we could benefit of a per thread getLastError
mechanism for errors not related to a parser context.

  Can you provide a concrete proposal ?

Hum, how about a simple
const xmlChar *xmlLastErrorMessage
per thread global in globals.h

Inside libxml, instead of calling xmlGenericError directly,
you could call a function that sets xmlLastErrorMessage AND
calls xmlGenericError.

  Well that won't provide any kind of numeric information. 
I though people had troubles with the fact that they received strings
of characters, not because they receive the error synchronously !

Do we need anything more complicated?
Error codes, maybe, but I'd say it's a different topic,
that would need to apply to the callback-based
error reporting too, thus requiring all new error
callbacks APIs.

  Yes, that's why I though it was now or never.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]