[Bug 4921] [XSLT 2++] Combining group-starting-with and group-ending-with

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4921





--- Comment #3 from Michael Kay <mike@saxonica.com>  2010-07-20 23:02:26 ---
Some further ideas on this.

(a) Extend the focus by providing next() and previous() accessors to return the
item after/before the context item in the sequence being traversed. With the
proviso that (i) these are only available in xsl:for-each, xsl:for-each-group,
and xsl:iterate, and (ii) they must be used lexically within that instruction,
so that the compiler can determine that it needs to maintain this information.

(b) Extend the options for positional grouping on xsl:for-each-group:

(b1) Allow group-starting-when and group-ending-when as alternatives to
group-starting-with and group-ending-with. The attributes are expressions
evaluated with the focus pointing to the item being tested. For example
group-starting-when="position() mod 2 = 0" starts a new group on even-numbered
items.

(b2) If both group-starting-with/when and group-ending-with/when are specified,
then groups can overlap. For example group-starting-when="true()"
group-ending-when="count(current-group()) = 3" starts a new 3-item group at
every item in the sequence (but see next point).

(b3) Attribute match-at-boundary=yes|no determines whether the first item is
deemed to match the group-starting-with pattern and the last item is deemed to
match the group-ending-with pattern. Default is yes for compatibility.

(b4) current-group-start-position() returns the position of the initial item of
the current group in the population; current-group-end-position() returns the
position of the final item of the current group in the population. 

Together, I believe these enhancements provide essentially all the capability
of XQuery's sliding/tumbling windows. We'll need to test this by coding up the
XQuery windowing use cases.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 20 July 2010 23:02:28 UTC