Subject: RE: [XSL] unparsed-text with relative URI's
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 13 Feb 2010 00:34:24 -0000
|
> 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
|