[Bug 29734] New: [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

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29734

            Bug ID: 29734
           Summary: [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
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0 Test Suite
          Assignee: abel.online@xs4all.nl
          Reporter: martin.honnen@gmx.de
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

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>

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 15 July 2016 11:35:43 UTC