[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [XSL] unparsed-text with relative URI's

Subject: Re: [XSL] unparsed-text with relative URI's
From: Calvados Boulard <calvados.boulard@xxxxxxxxx>
Date: Mon, 22 Feb 2010 15:44:16 -0800
Re:  [XSL] unparsed-text with relative URI's
Thanks Michael, using resolve-uri($regpit, base-uri(/)) did the trick.

By relative document, I meant to say a document that was in a location
relative to the document being transformed. i.e.
../../directory/file.xml

Thanks again.

On Fri, Feb 12, 2010 at 16:34, Michael Kay <mike@xxxxxxxxxxxx> wrote:
>>
>> I'm wondering how to set the base URI's static context
>> relative to that of the file being transformed.
>
> Eh? The static context includes a base URI. The base URI does not have a
> static context. Is this just a typo, or are you seriously confused about
> concepts?
>>
>> I've currently got my xsl located at
>> http://site1.ca/styles/myxsl.xsl, and am transforming a
>> document located at http://site2.ca/documents/mydocument.xml
>
> And where is the file whose existence you are trying to test?
>>
>> My xsl builds the location of the relative file, and attempts
>> to test for it's existence as below:
>
> There's no such thing as a "relative file", I'm not sure what you mean. And
> I can't see how the names used in this code relate to your site1.ca and
> site2.ca given above.
>>
>> <xsl:variable name="regpit" select="concat('../06_Regulations
>> Point in Time/',concat(translate(/reg/regnum, '/', '_'),
>> '_pit.xml'))"/> <xsl:if
>> test="unparsed-text-available(resolve-uri($regpit))">
>
> resolve-uri() with one argument resolves against the static base URI (that
> is, the location of the stylesheet). Which is exactly what
> unparsed-text-available() would do anyway. So this can't be right. If you
> want to resolve against the location of the source document, use
> resolve-uri($regpit, base-uri(/)).
>
> Regards,
>
> Michael Kay
> http://www.saxonica.com/
> http://twitter.com/michaelhkay

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.