xsl-list
[Top] [All Lists]

Re: [xsl] Sorting in order to count unique Records.

2006-09-05 13:39:27

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



--~------------------------------------------------------------------
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>