[xsl] URIResover question

Subject: [xsl] URIResover question
From: Andy Chambers <achambers.home@xxxxxxxxxxxxxx>
Date: Mon, 24 Aug 2009 14:28:31 +0100

I'd like to write a URIResolver that allows the xslt processor to read

<xsl:import href="utils.xsl"/>

and find a corresponding encrypted file, decrypt it, and return the results.

This I've managed to do OK using the URIResover interface.  It works
provided all the stylesheets
are in the same directory but it breaks when a stylesheet in
sub-directory "imports" another
stylesheet in that same sub-directory.

For example here is an example of how it would fail

main.xsl  (imports both include/utils-a, and include/utils-b)
  utils-a.xsl  (no imports here)
  utils-b.xsl  (imports utils-a)

utils-b has the following

<xsl:import href="utils-a.xsl"/>

When resolve gets called, base="", and href="utils-a.xsl" so my
URIResolver doesn't know that
it should look in the include directory to find utils-a.xsl

I think I could fix this if there was a way of finding out the
SystemId() of the file that has triggered
the call to resolve.  Is there a way to do this or am I going about
this the wrong way?

Many Thanks,

Current Thread