[lxml-dev] Failure with custom resolvers and relative xsl:import
Sidnei da Silva
sidnei at enfoldsystems.com
Mon Aug 18 21:21:30 CEST 2008
On Mon, Aug 18, 2008 at 4:04 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> The problem here is that lxml currently only takes the .name attribute of a
> file object to determine the file name. The right thing to do would be to use
> os.path.abspath(f.name) instead to retrieve the absolute path name of the file.
>
> Using resolve_filename(filename) instead of resolve_file(open(filename))
> provides a more efficient work around, though.
Okay, I think that solves one of the problems, when the filename is
local. I suspect it won't solve the other problem I had, which was
when the file comes from urlopen(). Since the files are relatively
small though I can keep using resolve_string() for now.
--
Sidnei da Silva
Enfold Systems http://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
More information about the lxml-dev
mailing list