|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] For-Each Sort or Sorting a Key
Hey Guys,
I'm having a little problem sorting a for-each statement. I want to get
the terms sorted as, Term 1, Term 2.. In numerical order, but the sort
statement is not working as expected. Is this because I'm looping
through the unsorted values of the termGroup key? Is there anyway to
sort the termGroup key when it is created or create a key on sorted
nodes?
Thanks,
Chris
<xsl:for-each select="../../../../../EVGroup[count(. | key('termGroup',
@term)[1]) = 1]">
<xsl:sort select = "./@term" data-type="number"/>
<xsl:variable name="term" select="./@term" />
<td class = "bg_4" align="right">
<xsl:choose>
<xsl:when test="self::node()[@term =
$term]/EVRecords/EVRecord/Awards/Award[@program = $program]/@amount >
0">
<xsl:value-of select="format-number(sum(self::node()[@term =
$term]/EVRecords/EVRecord/Awards/Award[@program = $program]/@amount),
'$#,##0')" />
</xsl:when>
<xsl:otherwise>
 
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:for-each>
*****xml snippet*******
<EVGroups>
<EVGroup begin="2004" end="2005" id="" status=""
term="2" view="" type="ind">
<EVRecords>
<EVRecord flag="1" ssn="811111111"
tab="pnd">
<Name first="Stan" last="Man"
mi="The" />
<Awards>
<Award amount="100"
program="TCHR" reason="" />
</Awards>
<Enroll date="2005-10-23"
pthours="6" status="PT" />
</EVRecord>
<EVRecord flag="0" ssn="911111111"
tab="pnd">
<Name first="Curious"
last="George" mi="" />
<Awards>
<Award amount="100"
program="KTG" reason="" />
</Awards>
<Enroll date="2005-10-23"
pthours="6" status="PT" />
</EVRecord>
<EVRecord flag="0" ssn="911111111"
tab="pnd">
<Name first="Curious"
last="George" mi="" />
<Awards>
<Award amount="100"
program="CAP" reason="" />
</Awards>
<Enroll date="2005-10-23"
pthours="6" status="PT" />
</EVRecord>
</EVRecords>
</EVGroup>
.
.
2004-2005 term 1
.
.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








