[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Re: Sorting on two levels

Subject: Re: [xsl] Re: Sorting on two levels
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Apr 2015 16:25:33 -0000

Michele R Combs mrrothen@xxxxxxx wrote:
I did try  <xsl:apply-templates select="current-group()">, thinking
it would just go through and apply the existing indexterm, primary,
secondary templates -- but I got the entire group in a chunk, it
didn't seem to apply templates to each element  individually.  I'll
go back and look, maybe I did something wrong there.  I wasn't using
mode, maybe that was the problem.

Doing the apply-templates on the group to use existing templates sounds like the right idea, I don't know why it did not work.
I only put in a mode to allow a processing step different from the normal handling.

Last question: if I want to do something at the end of each group,
I'd put that instruction right before the </xsl:for-each-group>,

Well thinking about it imperatively like "to do something at the end of each group" is not the right approach with a declarative language but the for-each-group contains a sequence constructor evaluated for each group and if you want to generate some output at the end of the sequence then do that by putting the instruction right before the closing </xsl:for-each-group>, that's right.

Current Thread