RE: [xsl] Sorting in A for-each-group

Subject: RE: [xsl] Sorting in A for-each-group
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 21 Jun 2007 08:58:58 +0100
> But in your solution you 
> placed the sort instruction in the 3rd for-each-group and it 
> produced the correct results, this is what i'm confused 
> about, isn't this suppose to sort the current-group in the 
> 3rd for-each-group which is the 3rd level div elements?

Suppose you are grouping employees by department and write

<xsl:for-each-group select="employee" group-by="department/@code">
  <xsl:sort select="department/budget"/>

This xsl:sort controls the order in which the departments are listed. It
does not control the order of the employees within each department.

Is this where your confusion lies?

Michael Kay
http://www.saxonica.com/

Current Thread