Selecting nodes ith the same attribute name value

Discussion in 'XML' started by DiTieM, Feb 9, 2006.

  1. DiTieM

    DiTieM Guest

    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
    DiTieM, Feb 9, 2006
    #1
    1. Advertising

  2. 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/
    Martin Honnen, Feb 9, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Olivier Wulveryck
    Replies:
    1
    Views:
    670
    Andrew Thompson
    Sep 14, 2004
  2. gavnosis
    Replies:
    0
    Views:
    511
    gavnosis
    Aug 2, 2003
  3. Timo Nentwig

    selecting nodes between other nodes

    Timo Nentwig, Jun 16, 2004, in forum: XML
    Replies:
    1
    Views:
    401
    Patrick TJ McPhee
    Jun 17, 2004
  4. Replies:
    1
    Views:
    567
    Soren Kuula
    Aug 24, 2006
  5. wimalopaan
    Replies:
    6
    Views:
    401
    Salt_Peter
    Nov 22, 2008
Loading...

Share This Page