[Home] [By Thread] [By Date] [Recent Entries]
Thanks Andrew,
Your template one scrambles the <Date> order. Have not investigated why as Murray's template worked almost perfectly. Thanks for the <Group...> idea. It will make a nice debugging feature for me in the future. Mark -----Original Message----- From: Andrew Welch Sent: Wednesday, July 27, 2011 12:24 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Sorting seems not to work completely On 27 July 2011 19:59, Mark <mark@xxxxxxxxxxxx> wrote: Hello Michael, I'm not sure I understood the '+' in <xsl:for-each select+"current-group()"> typo... :) I tried the below template. [1] gives me the <Stamp> elements grouped under
<xsl:template match="List">
<xsl:element name="List">
<xsl:for-each-group select="Item/Stamp"
group-by="Date/concat(@year, @month, @day)">
<xsl:sort select="current-grouping-key()" data-type="number"/>
<xsl:element name="Group{position()}">
<xsl:for-each select="current-group()">
<xsl:sort select="@value" order="descending"
data-type="number"></xsl:sort>
<xsl:copy-of select="." copy-namespaces="no"/>
</xsl:for-each>
</xsl:element>
</xsl:for-each-group>
</xsl:element>
</xsl:template>
|

Cart



