Re: [xml] why is htmlNewParserCtxt static?



On Thu, Sep 21, 2006 at 10:15:41AM +1000, Michael Day wrote:
The entity loader is passed an xmlParserCtxtPtr, which allows 
document-specific options to be passed in using the _private field and 
used by the entity loader (as long as you don't use xmlReader :) So when 
I parse a document I want to pass in some stuff in the _private field of 
the context.

  Okay,

Normally I would use xmlReadFile(), but that creates its own context and 
destroys it afterwards and doesn't give me a chance to put anything in 
_private. However, xmlCtxtReadFile() looks like just what I want, as it 
takes a context that I've already created with the appropriate stuff in 
_private.

On the HTMLparser side of things I can't do this, as htmlNewParserCtxt() 
is static and I can't call it. I want to call htmlCtxtReadFile(), but 
first I need to create a context, set the _private field and pass it in.

  Okay, makes sense, you need to be able to bootstrap htmlCtxtRead*()
Fixed in CVS !

  thanks :-)

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
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]