RE: [xsl] Methods for changing the context node ?

Subject: RE: [xsl] Methods for changing the context node ?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 12 Sep 2007 19:46:17 +0100
> Some places I am using 
> <for-each> even though there is really not an iteration process.

In XSLT 1.0 there are a few places where you have to set the context node in
order to use some functionality. In nearly all these cases, 2.0 allows you
to apply the same operation to an arbitrary node supplied as a variable:

* the id() and key() and lang() functions

* xsl:number (has a select attribute in 2.0)

In fact, the only thing I can think of that still requires setting of the
context node in 2.0 is unparsed-entity-uri(). And there you can use
$x/unparsed-entity-uri().

So I think that using xsl:for-each to set the context node should no longer
be necessary.

Michael Kay
http://www.saxonica.com/

Current Thread