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

Re: Sorting in order to count unique Records.

Subject: Re: Sorting in order to count unique Records.
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 5 Sep 2006 21:39:04 +0100
order by count
> I'm setting up a recursive template in order to count the amount of
> unique records at the end for tabulation.

This is usually done using a grouping idiom (see jeni's pages for xslt1
or for-each-group in xslt2)

> I'm wondering if I can use xsl:sort to get the names in order, then
> have the template check to see if the following-sibling matches.

xsl:sort changes the order in which teh results of processing nodes are
added to the result tree, it doesn't change the input tree, so it does
not change the preceding-sibling axis of the nodes.

> Would xsl:sort only sort the first record (doing nothing)?
yes.

              <xsl:for-each select="Record[1]">
              <xsl:apply-templates select="." />
    </xsl:for-each>

That is equivalent to 
<xsl:apply-templates select="Record[1]"/>

David

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.