w3c / qtspecs

XSLT and XQuery Specifications - the source used to build the specs, and the errata
Other
30 stars 25 forks source link

[xslt30] xsl:for-each-group/@composite description typo #28

Closed ToshihikoMakita closed 3 years ago

ToshihikoMakita commented 3 years ago

xsl:for-each-group/@composite is described as follows:

https://github.com/w3c/qtspecs/blob/master/specifications/xslt-30/html/xslt30.xml

<phrase diff="chg" at="G">If <code>composite="yes"</code> is specified, there is
   a single grouping key whose value is the resulting sequence; otherwise, there is a set of
   grouping keys, consisting of the distinct atomic values present in the result
   sequence.</phrase>

From its original meaning, I guessed composite="yes" should be written as composite="no".

I have tested with Saxon implementation (HE 9.9.1.7) and when composite="no" and @group-adjacent returns more than one items, the transformation ended with following error message:

[xslt] D:\DITA-OT\dita-ot-3.6.1\plugins\com.antennahouse.pdf5.ml\xsl\dita2fo_indexcommon_index_out.xsl:242:32: Fatal Error! A sequence of more than one item is not allowed as the @group-adjacent attribute of xsl:for-each-group ("#all", "1", ...) 

According to the actual implementation result, I think composite="yes" is a typo of composite="no".

Regards,

michaelhkay commented 3 years ago

I think the spec is correct.

The error you are seeing is described in the spec: [ERR XTTE1100] It is a type error if the result of evaluating the group-adjacent expression is an empty sequence or a sequence containing more than one item, unless composite="yes" is specified.

Perhaps it could have been better explained.

I hope that clarifies.

ToshihikoMakita commented 3 years ago

Thank you for your clarification. The explanation is concrete. I was reading the specification without the deep consideration about the key and the results.