xsl-list
[Top] [All Lists]

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

2010-02-12 18:34:54

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 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>