Subject: Re: [xsl] combining multiple documents|
From: Steven Ericsson-Zenith <steven@xxxxxxxxxxxxx>
Date: Sun, 27 Jan 2008 07:52:59 -0800
With respect, Steven
My primary concern, in this case, relates to the scope of keys. If a key name is specified in a style sheet as some global name, I am a little concerned that the name is context sensitive.
Have you read the specification? I suspect you wouldn't be using the word
"key" like that if you had.
A key definition is a set of xsl:key declarations sharing the same name. Key
definitions are global, and they are not context sensitive.
The effect of the key() function with three arguments key(N, V, R) is to
select all nodes that match the match pattern of one of the key declarations
in the key definition named N, that are descendants-or-self of R, where the
result of evaluating the use expression of the key declaration, with N as
the context node, returns a sequence containing an item that is equal to one
of the items in V.
The effect of key() with two arguments key(N, V) is the same as key(N, V,
(/)). That is, the third argument defaults to "/", which returns the root of
the tree containing the context node. That is context sensitive, by virtue
of the definition of "/".
Michael Kay http://www.saxonica.com/