[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Counting uniquely selected values of elements

Subject: RE: Counting uniquely selected values of elements
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Mon, 14 Apr 2003 13:19:57 +0000
xsl uniq
Thanks for the very quick response.

I am not that good at keys, though - always avoiding them when possible - so just one moer question on this:

The a and b elements are always there but there might be some (d) elements before the c element: a/b/d/c, perhaps a/b/d/e/f/c.

Kan I in the solution below, just substitute a/b/c with a/b//c?

Thanks again.

Ragulf Pickaxe :)


See <http://jenitennison.com/xslt/grouping>


<xsl:key name="uniq" match="a/b/c" use="." />

<xsl:template match="root">
<xsl:for-each select="a/b/c[generate-id(.) = generate-id(key('uniq', .))]">
<xsl:value-of select="."/> occurs <xsl:value-of select="count(key('uniq', .))"/> times. <xsl:text/>
</xsl:for-each>
</xsl:template>


Cheers,

Jarno - neuroticfish: wakemeup! (club-edit)



_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.