Hi all,
   I've been developing XSLT 3.0's for-each-group element's
implementation, on xalan-java repo's branch xalan-j_xslt3.0.

With the current xsl:for-each-group's implementation that's available
on the above mentioned XalanJ repos's branch, I've a doubt with
following XSLT transformation example (which is mentioned within XSLT
3.0 spec, within section "14.4 Examples of Grouping"),

XML input document,

<titles>
    <title>A Beginner's Guide to <ix>Java</ix></title>
    <title>Learning <ix>XML</ix></title>
    <title>Using <ix>XML</ix> with <ix>Java</ix></title>
</titles>

Desired XSLT transformation output,

<h2>Java</h2>
    <p>A Beginner's Guide to Java</p>
    <p>Using XML with Java</p>
<h2>XML</h2>
    <p>Learning XML</p>
    <p>Using XML with Java</p>

The XSLT 3.0 spec says that, following is a solution to this XSLT
transformation problem,

<xsl:template match="titles">
    <xsl:for-each-group select="title" group-by="ix">
      <h2><xsl:value-of select="current-grouping-key()"/></h2>
      <xsl:for-each select="current-group()">
        <p><xsl:value-of select="."/></p>
      </xsl:for-each>
    </xsl:for-each-group>
</xsl:template>

With the above mentioned XSLT stylesheet, the XalanJ's implementation
produces following XML transformation result,

<h2>Java</h2>
<p>A Beginner's Guide to Java</p>
<h2>XML</h2>
<p>Learning XML</p>
<p>Using XML with Java</p>

As we can see, XalanJ's XSLT transformation result, doesn't have two
XML elements within the first group (whose grouping key is "Java"),
but only one. According to XSLT 3.0 spec, one of the items of original
XML elements list is assigned to two groups, whereas, XalanJ assigns
this XML element to only one of the group.

Is for this, XSLT 3.0 spec's example's desired XSLT transformation
output correct, or XalanJ's (repos xalan-java and its branch
xalan-j_xslt3.0) XSLT transformation output correct?

Any thoughts, shall be nice to know.


-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to