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



Hi,

on 2/12/2004 4:20 PM Daniel Veillard wrote:

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.

Yes, I wasn't sure about this. But the dilemma is that I can set 
*nothing* on the context, no userData nor _private, since the 
xmlParserContext is created inside the xmlReadxxx functions.

Regards,

Kasimier




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