[lxml-dev] XInclude does not support Resolvers?
Stefan Behnel
behnel_ml at gkec.informatik.tu-darmstadt.de
Tue Nov 28 16:14:45 CET 2006
Hi,
Sidnei da Silva wrote:
> I was looking at the XInclude functionality and noticed that it does
> use the 'resolvers'. Is that a missing feature or it just can't be
> done at all?
It's rather hard to do with the current libxml2.
The way it works with parsers is: we create a libxml2 parser context and store
a pointer to the Python resolver context in it, which allows us to call the
resolvers from the C code when requested.
libxml2's XInclude API does not allow us to modify the parser context it uses,
so there is currently no way to hand the resolvers over to the lookup
function. When the custom lookup function of lxml is called from the XInclude
code, we just can't figure out if there are any resolvers to call at that point.
We could consider using something like thread contexts to store the resolvers,
but that should uglify the way it's currently done and I don't know if we'd
get into trouble in other places. So I currently do not consider it worth the
effort.
Stefan
More information about the lxml-dev
mailing list