Please suggest how to do grouping withstream option xslt3. Here total height of each Table (grouping on its ID, if same table info repeated) needs calculate.
Input XML:
<AreaRoot>
<TableAndCaptionArea generated-by="table" id="t0005-tSC" height="90.488pt" display-role="block">
<a>One</a>
</TableAndCaptionArea>
<TableAndCaptionArea generated-by="table" id="t0005-tSC" height="33.3pt" display-role="block">
<a>Two</a>
</TableAndCaptionArea>
<TableAndCaptionArea generated-by="table" id="t0005-tDC" height="91.594pt" display-role="block">
<a>Three</a>
</TableAndCaptionArea>
<TableAndCaptionArea generated-by="table" id="t0005-tLS" height="91.594pt" display-role="block">
<a>Four</a>
</TableAndCaptionArea>
</AreaRoot>
XSLT 3.0:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
<!--xsl:mode streamable="yes"/-->
<xsl:mode streamable="yes" on-no-match="shallow-copy"/>
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:fork>
<xsl:for-each-group select="descendant::*:TableAndCaptionArea[@id]" composite="yes" group-by="@id">
<table>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<!--Height of a table -->
<xsl:attribute name="height">
<xsl:variable name="var1">
<a>
<xsl:for-each select="current-group()/@height">
<b><xsl:value-of select="replace(., 'pt', '')"/></b>
</xsl:for-each>
</a>
</xsl:variable>
<xsl:value-of select="sum($var1/*:a/*:b)"/>
</xsl:attribute>
</table>
</xsl:for-each-group>
</xsl:fork>
</xsl:template>
</xsl:stylesheet>
Getting Error while running:
Error on line 8 of Stream2.xsl:
XTSE3430: Template rule is not streamable
* The xsl:for-each-group/@select expression has crawling posture (that is, itcan select overlapping nodes)
Required Result:
<ATRinfo>
<height>
<table id="t0005-tSC" height="123.788"/>
<table id="t0005-tDC" height="91.594" />
<table id="t0005-tLS" height="91.594"/>
</height>
</ATRinfo>
Using SaxonEE9-9-0-2J version. Please suggest how to resolve the error.