title: Grouping in XSLT3 with xsl streaming, but getting 'Template rule is not streamable' error
body: <p>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.</p>
  
  <p><strong>Input XML:</strong></p>
  
  <pre><code>&lt;AreaRoot&gt;
  &lt;TableAndCaptionArea generated-by="table" id="t0005-tSC"  height="90.488pt" display-role="block"&gt;
  &lt;a&gt;One&lt;/a&gt;
  &lt;/TableAndCaptionArea&gt;
  &lt;TableAndCaptionArea generated-by="table" id="t0005-tSC" height="33.3pt" display-role="block"&gt;
  &lt;a&gt;Two&lt;/a&gt;
  &lt;/TableAndCaptionArea&gt;
  &lt;TableAndCaptionArea generated-by="table" id="t0005-tDC" height="91.594pt" display-role="block"&gt;
  &lt;a&gt;Three&lt;/a&gt;
  &lt;/TableAndCaptionArea&gt;
  &lt;TableAndCaptionArea generated-by="table" id="t0005-tLS" height="91.594pt" display-role="block"&gt;
  &lt;a&gt;Four&lt;/a&gt;
  &lt;/TableAndCaptionArea&gt;
  &lt;/AreaRoot&gt;
  </code></pre>
  
  <p><strong>XSLT 3.0:</strong></p>
  
  <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"&gt;
  
  &lt;!--xsl:mode streamable="yes"/--&gt;
  &lt;xsl:mode streamable="yes" on-no-match="shallow-copy"/&gt;
  
  &lt;xsl:output method="text"/&gt;
  
  &lt;xsl:template match="/"&gt;
      &lt;xsl:fork&gt;
          &lt;xsl:for-each-group select="descendant::*:TableAndCaptionArea[@id]" composite="yes" group-by="@id"&gt;
              &lt;table&gt;
                  &lt;xsl:attribute name="id"&gt;&lt;xsl:value-of select="@id"/&gt;&lt;/xsl:attribute&gt;
                  &lt;!--Height of a table --&gt;
                  &lt;xsl:attribute name="height"&gt;
                      &lt;xsl:variable name="var1"&gt;
                          &lt;a&gt;
                              &lt;xsl:for-each select="current-group()/@height"&gt;
                                  &lt;b&gt;&lt;xsl:value-of select="replace(., 'pt', '')"/&gt;&lt;/b&gt;
                              &lt;/xsl:for-each&gt;
                          &lt;/a&gt;
                      &lt;/xsl:variable&gt;
                      &lt;xsl:value-of select="sum($var1/*:a/*:b)"/&gt;
                  &lt;/xsl:attribute&gt;
              &lt;/table&gt;
          &lt;/xsl:for-each-group&gt;
      &lt;/xsl:fork&gt;
  &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p><strong>Getting Error while running:</strong></p>
  
  <pre><code>    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)
  </code></pre>
  
  <p><strong>Required Result:</strong></p>
  
  <pre><code>&lt;ATRinfo&gt;
      &lt;height&gt;
      &lt;table id="t0005-tSC" height="123.788"/&gt;
      &lt;table id="t0005-tDC" height="91.594" /&gt;
      &lt;table id="t0005-tLS" height="91.594"/&gt;
      &lt;/height&gt;
  &lt;/ATRinfo&gt;
  </code></pre>
  
  <p>Using SaxonEE9-9-0-2J version. Please suggest how to resolve the error.</p>