Re: New grouping feature in XSLT 4: break-when

Yes, I'm still experimenting with the design of this; I've tried it out both as an extension to xsl:for-each-group and as a higher-order function. I put it together as a response to one of the perennial grouping support questions where the break conditions depend on more than the immediately adjacent items, the canonical example being starting a new line after the accumulated string-length of words in the current line exceeds N.

I think that having break condition that's decided as a function of both the current group and the next item gives a lot of power without going quite as far as XQuery tumbling windows, and it's presumably streamable at least to the extent that you only need to keep one group in memory at a time.

Any comments are of course welcome, on this or any other part of the draft.

In the new year I want to introduce some process to this exercise: get a requirements document or short spec agreed, then work through the items on the list systematically. At the moment there's a fair bit of prototyping of ideas (which I find it easier to do by actually trying out the textual changes needed, because that tends to lead to discovery of the edge cases that need to be addressed).

Michael Kay
Saxonica


> On 14 Dec 2020, at 14:48, Martin Honnen <martin.honnen@gmx.de> wrote:
> 
> 
> On 14.12.2020 15:46, Martin Honnen wrote:
>> 
>> Reading
>> https://qt4cg.org/branch/master/xslt-40/Overview-diff.html#xsl-for-each-group
>> 
>> I have for the first time seen the new feature of
>> for-each-group/@group-when.
> 
> 
> I meant to write for-each-group/@break-when.
> 
> 
>> 
>> Trying to understand it I wonder whether it arose from some Slack or
>> GitHub discussion I have missed. Any pointers?
>> 
>> Is it an attempt to introduce some of the features of XQuery's windowing
>> clause and relevant variables into XSLT 4?
>> 
>> 
> 

Received on Monday, 14 December 2020 17:32:08 UTC