Closed ToshihikoMakita closed 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.
With group-by, composite=no, an item can be added to more than one group: each value of the grouping key is considered individually, so if the key is ("France", "Germany") then the item is added to both the France group and the Germany group.
With group-by, composite=yes, each item is added to exactly one group: so if the key is ("France", "Germany") then the item is added to the group of items having the key ("France", "Germany").
With group-adjacent, composite="no", the grouping key must be a single item, or XTTE1100 results.
With group-adjacent, composite="yes", each item is added to exactly one group: so if the key is ("France", "Germany") then the item is added to the group of adjacent items having the key ("France", "Germany").
I hope that clarifies.
Thank you for your clarification. The explanation is concrete. I was reading the specification without the deep consideration about the key and the results.
xsl:for-each-group/@composite
is described as follows:https://github.com/w3c/qtspecs/blob/master/specifications/xslt-30/html/xslt30.xml
From its original meaning, I guessed
composite="yes"
should be written ascomposite="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:According to the actual implementation result, I think
composite="yes"
is a typo ofcomposite="no"
.Regards,