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

RE: [xsl] Selecting nodes with the same attribute value


Subject: RE: [xsl] Selecting nodes with the same attribute value
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 9 Feb 2006 17:00:51 -0000

You are trying to do grouping: in XSLT 2.0, use xsl:for-each-group. For XSLT
1.0, consult http://www.jenitennison.com/xslt/grouping

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


> -----Original Message-----
> From: David Trallero [mailto:ditiem@xxxxxxxxx] 
> Sent: 09 February 2006 16:36
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Selecting nodes with the same attribute value
> 
> I would like to make a call to <xsl:apply-templates select="nodes with
> the same name"/>.
> 
> To understand this better, we could think about email. In an email box
> there are several
> emails from several users. When clicking in "Order by Date" or "Order
> by Name" all emails
> are grouped by that "attribute". I would exactly to do that:
> 
> If we have:
> <email>
>   <name>N1</name>
>   ....
> </email>
> 
> <email>
>   <name>N1</name>
>   ....
> </email>
> 
> <email>
>   <name>N2</name>
>   ....
> </email>
> 
> <email>
>   <name>N2</name>
>   ....
> </email>
> 
> <email>
>   <name>N2</name>
>   ....
> </email>
> 
> <email>
>   <name>N3</name>
>   ....
> </email>
> 
> I would like to have the tree instantiated in
> 
> <xsl:template select="inbox/emails/name">
> 
> </xsl:template>
> 
> to
> 2 emails of N1
> 3 of N1
> 1 of N3
> 
> Is that possible?
> 
> Thans in Advance,
> David


Current Thread
Keywords