xsl-list
[Top] [All Lists]

Re: [xsl] Count items in a key ?

2010-10-13 16:42:10
Did you mean xs:anyAtomicType*   ? Yes, this is precise.

According to http://www.w3.org/TR/xpath-datamodel/#types-hierarchy
xs:anyType seemed to be the most generic type, but I'm not an xpath/schema
datatype guru ;)

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
specifying the values of the key. The expression will be evaluated
with the node that matches the pattern as the context node. The result
of evaluating the expression is atomized.

Similarly, if a sequence constructor is present, it is used to
determine the values of the key. The sequence constructor will be
evaluated with the node that matches the pattern as the context node.
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*


-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>