xsl-list
[Top] [All Lists]

RE: Selecting nodes with the same attribute value

2006-02-09 10:00:51
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(_at_)gmail(_dot_)com] 
Sent: 09 February 2006 16:36
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>