Re: [xml] why is htmlNewParserCtxt static?



Hi Daniel,

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.

I've just realised that the XInclude mechanism does not support this, as it creates its own XML parser context internally and doesn't provide any mechanism to pass in user data via the _private field.

Specifically I am calling xmlXIncludeProcessFlags(), which in turn calls xmlXIncludeParseFile(), which creates a new parser context to do the parsing.

Is there some way that I could pass in my own xmlParserCtxtPtr to the XInclude API?

Alternatively, if the XML_PARSE_XINCLUDE flag applied to the xmlRead* functions then there would be no problem, but I understand that this flag is only implemented by the xmlReader API at the moment. Would it make sense to apply this flag to the regular SAX2 parser as well?

Best regards,

Michael

--
Print XML with Prince!
http://www.princexml.com



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