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

sort, count, number, group

Subject: sort, count, number, group
From: quagly <quagly@xxxxxxxx>
Date: Sat, 11 Mar 2000 19:23:14 -0800
sort count
    After perusing the FAQ I can sort, count, number, and group.
    But I cannot do them all at once.  Please help.

    Example:

xml:

<root>
    <foo>
          <bar>bard</bar>
          <bar>bark</bar>
    </foo>
    <foo>
          <bar>bark</bar>
          <bar>barb</bar>
     </foo>
</root>

Sample xsl that selects distinct <bar>

<xsl:template match="//bar[not(. = following::bar)]">
     <xsl:value-of select="."/>
</xsl:template>

produces:

bard bark barb

what I want is to number these, sort them, and count the number of times
they appear in the xml source

Desired output:

1.  barb  -1
2.  bard  -1
3.  bark  -2

I can't seem to get there from here.  Do I need to use for-each?

Thanks,
            -Quagly




 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.