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

Re: [xsl] Count items in a key ?


Subject: Re: [xsl] Count items in a key ?
From: Stefan Krause <stf@xxxxxxxx>
Date: Fri, 15 Oct 2010 09:06:32 +0200

Am 13.10.2010 um 19:50 schrieb Dimitre Novatchev:

> On Wed, Oct 13, 2010 at 8:23 AM, Scott Trenda <Scott.Trenda@xxxxxxxx>
wrote:
>> New XSLT 2.1 feature? :)
>
>
> Could be something as:
>
>      keys(keyname as xs:string) as item()*
>
> and an additional overload:
>
>      keys(keyname as xs:string, document as document-node()) as item()*
>

Sometimes I would use this feature in this way:

<xsl:for-each select="keys('myKey')">
<xsl:if test="matches(., 'someRegularExpression')">
 do some stuff here with key('myKey', .) 

wich raises the wish for a shortcut:

key('myKey', 'someRegularExpression') or, more generic,

key('myKey', anyTwoArgumentFunction(myValue) as xs:boolean)

Maybe in XSLT 3.0 

Stefan


Current Thread
Keywords