Re: [xsl] for-each-group

Subject: Re: [xsl] for-each-group
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 27 Mar 2007 20:34:49 +0100
Robert C Corsaro wrote:
<xsl:for-each-group select="/products" group-by="product">
  <product><xsl:value-of select="product" /></product>

What am I doing wrong?  Basically I want something similar to 'GROUP BY'
 in SQL.

You're grouping the <products> element by the value of the <product> elements that it contains. You want to group the <product> elements based on their value:

  <xsl:for-each-group select="/products/product" group-by=".">
    <product><xsl:value-of select="." /></product>


Jeni Tennison

Current Thread