[lxml-dev] Failure with custom resolvers and relative xsl:import

Sidnei da Silva sidnei at enfoldsystems.com
Wed Aug 6 04:17:15 CEST 2008


Hi there,

I've got a reproducible failing test when using custom resolvers and
relative xsl:import. Basically, if I use resolve_string() or let the
default resolver do it's work, everything works fine. If I use
resolve_file though, the *next* uri to be resolved will have a
relative (to the previous uri resolved) filename, and then there's not
enough information available to compute the full URI.

This happens with lxml 2.1.1. I am pretty sure it didn't happen with
lxml 1.3.x series (which is what I was using before).

I'm attaching the problematic test and related files. For reference,
this is the problematic code:

...
    def resolve(self, uri, id, ctx):
        print uri
        # return None # works
        # return self.resolve_string(open(uri, 'r').read(), ctx) # works
        return self.resolve_file(open(uri, 'r'), ctx) # fails
...

-- 
Sidnei da Silva
Enfold Systems http://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lxml-test.tar.gz
Type: application/x-gzip
Size: 1163 bytes
Desc: not available
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20080805/31c16fd5/attachment.bin 


More information about the lxml-dev mailing list