Re: [xml] "xmlReadxxx & structured error handler & userData"



On Thu, Feb 12, 2004 at 10:16:35AM -0500, Daniel Veillard wrote:
On Thu, Feb 12, 2004 at 04:03:45PM +0100, Kasimier Buchcik wrote:
Hi,

if using the xmlReadxxx functions with a registered structured error 
handler, libxml2 channels a "xmlParserCtxtPtr" as the userData to the 
error handler. This is due to "xmlInitParserCtxt" where ctxt->userData 
is set to the ctxt itself, and the fact that the user cannot set 
ctxt->userData explicitely here. I wonder if one could add an 
initialization of "ctxt->userData = xmlStructuredError" after the 
context has been created to the xmlReadxxx functions.

  If you provide a contextual patch implementing it within 30 minutes
that could go in 2.6.6 ! Otherwise fill an RFE in bugzilla :-)

  Actually, now that I think about it, no that's not the proper way.
If you want to add your own metadata, then use the context _private
field for those. Since the context is passed back to the error handler
you should be able to get those from the structured error handler.

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]