This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29734 - [xslt30ts] si-fork-110 and si-fork-111 are supposed to test composite key use but xsl:for-each-group lacks the composite="yes" attribute
Summary: [xslt30ts] si-fork-110 and si-fork-111 are supposed to test composite key use...
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Abel Braaksma
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-15 11:35 UTC by Martin Honnen
Modified: 2017-01-28 22:01 UTC (History)
1 user (show)

See Also:


Attachments

Description Martin Honnen 2016-07-15 11:35:33 UTC
The file tests\strm\si-fork\_si-fork-test-set.xml has two tests si-fork-110 and si-fork-111 which are described as testing composite keys, however the code in the named templates g-010 and g-011 in the file si-fork-B.xsl does not have the setting 'composite="yes"' on the 'xsl:for-each-group' elements:

  <!-- streamed xsl:for-each-group with composite key -->

  <xsl:template name="g-010" use-when="$RUN">
    <out>
      <xsl:stream href="../docs/books-atts.xml">
        <xsl:fork>
          <xsl:for-each-group select="/BOOKLIST/BOOKS/ITEM" group-by="@PUB-DATE, @LANGUAGE">
            <CAT DATE="{current-grouping-key()[1]}" LANG="{current-grouping-key()[2]}"
              AVG-PRICE="{round(avg(current-group() / @PRICE), 3)}">
            </CAT>
          </xsl:for-each-group>
        </xsl:fork>
      </xsl:stream>
    </out>
  </xsl:template>

  <!-- streamed xsl:for-each-group with composite key (context item is first in group) -->

  <xsl:template name="g-011" use-when="$RUN">
    <out>
      <xsl:stream href="../docs/books-atts.xml">
        <xsl:fork>
          <xsl:for-each-group select="/BOOKLIST/BOOKS/ITEM" group-by="@AUTHOR, @PRICE">
            <xsl:variable name="group" select="copy-of(current-group())"/>
            <CAT ID="{distinct-values($group/@CAT)}" AUTHOR="{@AUTHOR}" PRICE="{@PRICE}"
              COUNT="{count($group)}"
              AVG-QTY="{round(avg($group / @QUANTITY), 3)}">
            </CAT>
          </xsl:for-each-group>
        </xsl:fork>
      </xsl:stream>
    </out>
  </xsl:template>

So to make sense the code needs to be changed to

  <!-- streamed xsl:for-each-group with composite key -->

  <xsl:template name="g-010" use-when="$RUN">
    <out>
      <xsl:stream href="../docs/books-atts.xml">
        <xsl:fork>
          <xsl:for-each-group select="/BOOKLIST/BOOKS/ITEM" group-by="@PUB-DATE, @LANGUAGE" composite="yes">
            <CAT DATE="{current-grouping-key()[1]}" LANG="{current-grouping-key()[2]}"
              AVG-PRICE="{round(avg(current-group() / @PRICE), 3)}">
            </CAT>
          </xsl:for-each-group>
        </xsl:fork>
      </xsl:stream>
    </out>
  </xsl:template>

  <!-- streamed xsl:for-each-group with composite key (context item is first in group) -->

  <xsl:template name="g-011" use-when="$RUN">
    <out>
      <xsl:stream href="../docs/books-atts.xml">
        <xsl:fork>
          <xsl:for-each-group select="/BOOKLIST/BOOKS/ITEM" group-by="@AUTHOR, @PRICE" composite="yes">
            <xsl:variable name="group" select="copy-of(current-group())"/>
            <CAT ID="{distinct-values($group/@CAT)}" AUTHOR="{@AUTHOR}" PRICE="{@PRICE}"
              COUNT="{count($group)}"
              AVG-QTY="{round(avg($group / @QUANTITY), 3)}">
            </CAT>
          </xsl:for-each-group>
        </xsl:fork>
      </xsl:stream>
    </out>
  </xsl:template>
Comment 1 Michael Kay 2017-01-28 22:01:11 UTC
The suggested change was committed on 3 November, it seems without any acknowledgement in the test metadata or here in bugzilla.