Re: [xsl] Referring to stylesheet itself, possible in XSLT 1.0, but how in XSLT 2.0?

Subject: Re: [xsl] Referring to stylesheet itself, possible in XSLT 1.0, but how in XSLT 2.0?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 17 Oct 2006 13:52:27 +0200
David Carlisle wrote:
With xml:base on the root matching matching template, why does calling
document('') return that base (the same goes for xsl:stylesheet). I
would've thought the root *node* returned from document('') was
outside the scope of the xml:base change,

if a node is returned it is outside the scope of xml:base but which node is returned depends on xml:base, '' is a relative uri so it is resolved against the current base uri to get the absolute URi of the document to be located. the resolution of '' is in teh scope of xml:base here.

Even after reading it thrice, it still dizzied me ;-)
May I use it (with the right copyright mention of course) at the next birthday party to impress (or dizzy) people?


For the facts, what I understand is that using xml:base can be quite dangerous, as one might loose the path of the xslt document itself (even though other documents may very well be relative to the base). It sounds trivial to begin with (xml:base sets the base path of etc), but can be entangling at large.

Cheers,
-- Abel Braaksma
  http://www.nuntia.com

Current Thread