XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Eliot KimberSubject: Controlling Resolution of Relative URLs
Author: Eliot Kimber
Date: 22 Sep 2002 03:41 PM
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).

Thanks,

Eliot

Posttop
Alberto MassariSubject: Re: Controlling Resolution of Relative URLs
Author: Alberto Massari
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)

Hope this helps,
Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.