I am using a web control called eXml which is an extention to ms xml web control which supports xslt 2.0
when trying to group elements i receive the following error:
group-by is not a valid extention element
is there a namespace or something a need to add.
my source is below
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="xhtml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<div>
<table width="100%" cellpadding="4" cellspacing="4" border="0">
<tr valign="top" align="left">
<th colspan="3">Stats Report</th>
</tr>
<xsl:for-each select="doc/StatsReport/Store">
<tr valign="top" align="left">
<td>
Store: <xsl:value-of select="@Number"/>
</td>
<td></td>
<td></td>
</tr>
<xsl:for-each select="KioskID">
<tr valign="top" align="left">
<td colspan="3">
KioskID: <xsl:value-of select="@KioskID"/>
</td>
</tr>
<tr>
<td colspan="3">
<hr></hr>
</td>
</tr>
<tr valign="top" align="left">
<td>
<h6>Keyword </h6>
</td>
<td>
<h6>Count</h6>
</td>
</tr>
<xsl:for-each-group select="Klog" group-by="@Keyword">
<tr>
<td>
<xsl:value-of select="current-grouping-key()"/>
</td>
<td>
<xsl:value-of select="sum(current-group()/@Count)"/>
</td>
</tr>
</xsl:for-each-group>
<xsl:for-each select="Keyword">
<tr>
<td>
<xsl:value-of select="@Name"/>
</td>
<td>
<xsl:value-of select="@NoCount"/>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</table>
</div>
</xsl:template>
</xsl:stylesheet>
Sample XML File:
<?xml version="1.0"?>
<doc>
<ReportName>Report2</ReportName>
<StartDate>Apr 4 2007 12:00AM</StartDate>
<EndDate>Jun 1 2007 11:59PM</EndDate>
<StatsReport><Store Number="123">
<KioskID KioskID="STCSW1">
<Klog Keyword="Keyword1" SubKeyword="" Count="77"/>
<Klog Keyword="Keyword2" SubKeyword="Name First" Count="4"/>
<Klog Keyword="Keyword2" SubKeyword="OrderForm" Count="1"/>
</KioskID>
</Store>
</StatsReport>
</doc>