Re: [xml] Error handling on a per-parser base



On Mon, Oct 25, 2010 at 09:09:03PM +0000, Ralf Mattes wrote:
Hello list,

is it possible to register a custom error function per xmlParserCtxtPtr
created by xmlCreatePushParserCtxt? I'd like to parse documents in 
parallel and would need error reporting per parser context. Dispatching
on user_data in the error callback seems inside out.

  You can set the ctxt->sax->serror assuming a SAXv2 to set a structured
error handler. But in general the disambiguation will be done based on
the context not based on the function. Setting a general strcutured
error handler should then allow this.
  But note that some errors may occur in part of the code where the
parsing context may not be available, and there you won't be able to
disambiguate,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



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