Re: [xsl] Count items in a key ?

Subject: Re: [xsl] Count items in a key ?
From: Olivier Jeulin <olivier.jeulin@xxxxxxxxx>
Date: Thu, 14 Oct 2010 00:03:49 +0200
Le 13/10/2010 23:41, Dimitre Novatchev a C)crit :
Actually, the values of the possible keys (the "using" attribute or
the sequence constructor of<xsl:key>) must all be atomic -- see:

http://www.w3.org/TR/2007/REC-xslt20-20070123/#element-key

"If the use attribute is present, its value is an expression
(b&)
The result of evaluating the sequence constructor is atomized."


This is why, using xs:anyAtomicType* is the precise return type of the proposed function:

keys(keyname as xs:string) as xs:anyAtomicType*

Yes, I read that part but couldn't figure the type after the atomization. Now I see: the values must be atomic, and thus cannot be an user-defined type or untyped.
The next part (in the spec) is easier to understand, I think:
"16.3.2 The key Function
key($key-name as xs:string, $key-value as xs:anyAtomicType*) as node()*"
==> $key-value as xs:anyAtomicType* ^^;


Thanks for you explanations, Dimitre and Ken.

Current Thread