The xml is as below:
<Words num="1">
<Word>
<search>Apple</search>
<replace>Fruit</replace>
</Word>
<Word num="2">
<search>Honda</search>
<replace>Car</replace>
</Word>
<Word num="3">
<search>Banana</search>
<replace>Fruit</replace>
</Word>
</Words>
I want to convert it in a table in html output (not xml output) - using grouping functionality (group by replace).
<table>
<tr><td>Replace: Fruit</td></tr>
<tr><td>Replace: Car</td></tr>
</table>
The code I've written is:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:for-each-group select="Words/Word" group-by="replace">
<tr>
<td>Replace: <xsl:value-of select="current-grouping-key()"/></td>
</tr>
</xsl:for-each-group>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
When opened xml file(linked with xslt) in Firefox, it returns "Error during XSLT transformation: XSLT transformation failed."
Can anyone provide me with guidance?
Thanks.