I am new to working with XSLT and am trying to create a pivot table using the Muenchian Method (since it appear that IE still doesn't support XSLT 2.0 I think I'm stuck with this). I am able to get the desired grouping however I am trying to get the sum of an attribute for each group. To do the sum of the attribute can I use the aggregate sum function or do I have to loop through the keys and store the values into a variable? This is what I have so far:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" encoding="UTF-8"/>
<xsl:key name="Person" match="Record" use="@PersonID" />
<xsl:template match="/">
<html>
<body>
<h2>Costs Per Person</h2>
<table border = "1">
<thead>
<tr>
<th>ID</th>
<th>Cost</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="Records/Record[generate-id() =
generate-id(key('Person', @PersonID)[1])]">
<tr>
<td>
<xsl:value-of select="@PersonID" />
</td>
<td>
<!-- Sum Of Cost -->
</td>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
</xsl:template>