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 9140 - [XSLT 2.0] Order of items within current-group() is unclear
Summary: [XSLT 2.0] Order of items within current-group() is unclear
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-24 20:12 UTC by Michael Kay
Modified: 2010-07-20 10:35 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2010-02-24 20:12:05 UTC
Problem raised by Vladimir Nestorovsky today on the xsl-list at mulberrytech.

The specification of xsl:for-each-group is unclear as to the order of items in each group (that is, the result of current-group()).

The intent is that the procedural algorithm given for each of the four grouping methods defines this order. But this relies on understanding that when an item is "added" to a group, or "assigned" to a group, it is added at the end of the sequence, which isn't explicitly stated.

Suggestion: in the rules for the four grouping methods, change "added" and "assigned" to "appended", and add a sentence at the end saying that the order in which items are added to each group determines the order of the items in the group as returned by the current-group() function.
Comment 1 Michael Kay 2010-05-13 16:54:11 UTC
The proposal in comment #0 has been approved in principle; an erratum will be drafted.
Comment 2 Michael Kay 2010-07-15 08:56:37 UTC
Erratum E43 will be raised as proposed.
Comment 3 Michael Kay 2010-07-20 10:35:30 UTC
I chose what I think is a simpler but equivalent solution: adding the paragraph:

In all cases the items within a group remain in population order. That is, if items <var>A</var> and <var>B</var> are in the same group, then <var>A</var> will precede <var>B</var> in the group if <var>A</var> preceded <var>B</var> in the population.