xsl-list
[Top] [All Lists]

Re: [xsl] Count items in a key ?

2010-10-15 02:06:52

Am 13.10.2010 um 19:50 schrieb Dimitre Novatchev:

On Wed, Oct 13, 2010 at 8:23 AM, Scott Trenda 
<Scott(_dot_)Trenda(_at_)oati(_dot_)net> 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
--~------------------------------------------------------------------
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>