I am generating a PDF from an XML document via XSL using Java and I am getting the following error:
ERROR: 'Unsupported XSL element 'http://www.w3.org/1999/XSL/Transform:for-each-group''
Please find my below XSL stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0">
<xsl:param name="rows-per-page" select="4"/>
<xsl:output method="html" indent="yes" html-version="5"/>
<xsl:template match="/receipt">
<html>
<head>
<style>
@page {size: a4 landscape;}
tbody { page-break-after: always; }
</style>
</head>
<body>
<table >
<thead>
<tr >
<th >Line</th>
<th>Item Code</th>
</tr>
</thead>
<xsl:for-each-group select="order/page/line_number" group-adjacent="(position() - 1) idiv $rows-per-page">
<tbody>
<xsl:apply-templates select="current-group()"/>
</tbody>
</xsl:for-each-group>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="line_number">
<tr style="font-size: 9px;">
<td><xsl:value-of select="." /></td>
<td><xsl:value-of select="following-sibling::product_code[1]" /></td>
</tr>
</xsl:template>
</xsl:stylesheet>