Re: [xsl] xml:base, resolve-uri and imported xslt files: how to get the importing base url from imported xslt

Subject: Re: [xsl] xml:base, resolve-uri and imported xslt files: how to get the importing base url from imported xslt
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 09 Oct 2006 18:14:12 +0200
Abel Braaksma wrote:



Then in specific.xslt you can override $pathToConfig with whatever you want, eg:

<xsl:variable nam="pathToConfig" select="concat('../../', $param-config-url)"/>

Aha! There come in the precedence rules! Funny, never realized I could redeclare and/or override parameters/variables. Let's try to make that work.



Hmm, for some reason, using the path in this overloaded variable, is still interpreted as relative to the imported stylesheet, instead of the importing stylesheet. The only resolution appears to be (I think), using resolve-uri in the importing stylesheet to make sure it is an absolute path to begin with.


This, however, defies my interpretation of the specs. It says (http://www.ietf.org/rfc/rfc3986.txt, secion 5.1.2):

"Thus, the default base URI of a representation is the base URI of the entity in which the representation is encapsulated."

And from the xslt specs and from the books, I understand that they should follow this RFC (http://www.w3.org/TR/xpath-functions/#func-resolve-uri and http://www.w3.org/TR/xslt20/#unparsed-text). Shouldn't that mean that the base uri, on any given moment, is defined as the base uri of the main document (the importing document)? Or is this simply a bug in the Saxon parser?

-- Abel Braaksma

Current Thread