Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Selecting nodes ith the same attribute name value

Reply
Thread Tools

Selecting nodes ith the same attribute name value

 
 
DiTieM
Guest
Posts: n/a
 
      02-09-2006
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=3D"inbox/emails/name">

</xsl:template>

to
2 emails of N1
3 of N1
1 of N3

Is that possible?

Thans in Advance,
David

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      02-09-2006


DiTieM wrote:

> I would like to make a call to <xsl:apply-templates select="nodes with
> the
> same name"/>.


Learn about keys and using them for grouping in XSLT 1.0, see here for
example
<http://www.jenitennison.com/xslt/keys.xml>
<http://www.jenitennison.com/xslt/grouping/index.xml>




--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
const-correctness: what ist wrong ith this code??? wimalopaan C++ 6 11-22-2008 08:56 AM
Selecting Nodes Using Subtotal of Child Nodes renfrochris@hotmail.com XML 1 08-24-2006 12:30 AM
Problem with XPath JDOM: Always the same value returned when selecting different nodes. Olivier Wulveryck Java 1 09-14-2004 01:34 PM
selecting nodes between other nodes Timo Nentwig XML 1 06-17-2004 04:54 AM
Reality check: Is it sensible to link XML nodes to other XML nodes in the same file? gavnosis XML 0 08-02-2003 08:22 AM



Advertisments