Re: [xsl] Using for-each-group on a <day> collection to arrange a weekday calendar

Subject: Re: [xsl] Using for-each-group on a <day> collection to arrange a weekday calendar
From: "Michael Friedman sumarimike@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 7 Nov 2017 18:58:47 -0000
Martin, Christophe,

Thanks for the feedback - I tried Martin's code first and it worked
perfectly. I'm reminded kindly how much I still have to learn, especially
as a visual person with not a lot of math experience.

Sorting by groups was my attempt to change the unexpected output without
knowing exactly what I was doing. It didn't work, but I left it in because
I didn't want to leave anything out when asking for help. Combining the
for-each and apply-templates worked well.

Kind regards,
Michael

The usual approach with positional grouping is by
>
>   <xsl:for-each-group select="descendant::day" group-adjacent="(position()
> - 1) idiv 5">
>
> <xsl:sort select="position()" order="ascending" data-type="number"/>
>>
>
> Not sure what sorting groups by ascending position is supposed to achieve.
>
> <fo:table-row height="15pt" background-color="gray" border-top="1pt solid
>> black">
>> <xsl:for-each select="current-group()">
>> <xsl:apply-templates select="self::day" mode="calendartitle"/>
>> </xsl:for-each>
>>
>
> It seems the for-each and apply-templates can be combined to
>   <xsl:apply-templates select="current-group()" mode="calendartitle"/>

Current Thread