I am experimenting with implementing XInclude's include element in XSLT and I'm having a problem with the document() function when using the SS XSLT processor: relative URLs/paths are resolved relative to the location of the style sheet, not the input document. I have tried setting the HTML resolution point and unsetting the "save paths relative to XSLT" boxes, but to no avail.
My code looks like this:
select="document($xpath)"/>
I get this behavior both from the latest 4.x product and the 4.5 beta (4.100g).
Subject:Re: Controlling Resolution of Relative URLs Author:(Deleted User) Date:23 Sep 2002 06:50 AM
Hi Eliot,
At 15.57 22/09/2002 -0400, you wrote:
>From: "Eliot Kimber"
>
>I am experimenting with implementing XInclude's include element in XSLT
>and I'm having a problem with the document() function when using the SS
>XSLT processor: relative URLs/paths are resolved relative to the location
>of the style sheet, not the input document.
This is the correct behaviour of the document() function. From the spec:
"The URI reference may be relative. [...] If the second argument is
omitted, then it defaults to the node in the stylesheet that contains the
expression that includes the call to the document function".
If you want to specify that the relative URI specified by the first
argument should be resolved against a different Base URI, you should
specify it in the second argument; for instance,
select="document($xpath,.)"/>
(if the current context node comes from the XML file whose file name you
want to use as the base for the $xpath relative URI)