[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] combining multiple documents


Subject: RE: [xsl] combining multiple documents
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 27 Jan 2008 10:18:32 -0000

> 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/


Current Thread