Subject: Re: [xsl] sort problem From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Wed, 05 Jan 2011 17:42:52 +0100 |
I am aggregating and sorting long lists of codes in this format:
<list> <cc area="W" main="7">W.7</cc> <cc area="W" main="8">W.8</cc> <cc area="W" main="4">W.4</cc> <cc area="W" main="1">W.1</cc> <cc area="W" main="1" exp="a">W.1.a</cc> <cc area="W" main="1" exp="b">W.1.b</cc> <cc area="W" main="1" exp="c">W.1.c</cc> <cc area="W" main="7">W.7</cc> <cc area="W" main="8">W.8</cc> <cc area="W" main="9">W.9</cc> </list>
Here is my 2.0 template:
<xsl:template match="list"> <list>
<xsl:for-each-group select="." group-by="cc"> <xsl:sort select="@area" order="descending"/> <xsl:sort select="@main" data-type="number"/>
You probably want <xsl:for-each-group select="cc" group-by="."> <xsl:sort select="@area" order="descending"/> <xsl:sort select="number(@main)"/>
Martin Honnen http://msmvps.com/blogs/martin_honnen/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] sort problem, Terry Ofner | Thread | Re: [xsl] sort problem, Terry Ofner |
[xsl] sort problem, Terry Ofner | Date | Re: [xsl] sort problem, Terry Ofner |
Month |