XSLT Newbie: grouping

Discussion in 'XML' started by petr.simek@gmail.com, Aug 25, 2006.

  1. Guest

    Hello,
    I have this XML:

    <document>
    <header>One</header>
    <para>Haleluja</para>
    <para>Haleluja</para>
    <para>Haleluja</para>
    <para>Haleluja</para>
    <header>Two</header>
    <para>Haleluja</para>
    <para>Haleluja</para>
    <para>Haleluja</para>
    <header>Three</header>
    <para>Haleluja</para>
    <para>Haleluja</para>
    <para>Haleluja</para>
    <para>Haleluja</para>
    <para>Haleluja</para>
    </document>

    and need it to get to this XML:

    <body>
    <section>
    <title>Jedna</title>
    <p>Haleluja</p>
    <p>Haleluja</p>
    <p>Haleluja</p>
    <p>Haleluja</p>
    </section>
    <section>
    <title>Two</title>
    <p>Haleluja</p>
    <p>Haleluja</p>
    <p>Haleluja</p>
    </section>
    <section>
    <title>Three</title>
    <p>Haleluja</p>
    <p>Haleluja</p>
    <p>Haleluja</p>
    <p>Haleluja</p>
    <p>Haleluja</p>
    </section>
    </body>

    I really do not know how to handle these sections correctly. How to
    force the engine to open the section before each header and close it
    after each last para.
    Is it possible with XSLT?
    Thank you for any advice.

    Petr Simek
    , Aug 25, 2006
    #1
    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. Christian Ludwig

    XSLT: sorting and grouping

    Christian Ludwig, Nov 24, 2003, in forum: XML
    Replies:
    2
    Views:
    598
    Christian Ludwig
    Nov 26, 2003
  2. Kevin Brown
    Replies:
    3
    Views:
    539
    Kevin Brown
    Aug 28, 2004
  3. Graham

    Help Grouping/Counting XSLT

    Graham, Sep 17, 2004, in forum: XML
    Replies:
    3
    Views:
    559
    =?ISO-8859-1?Q?J=FCrgen_Kahrs?=
    Sep 17, 2004
  4. Jody Greening
    Replies:
    5
    Views:
    669
    Jody Greening
    Jan 6, 2005
  5. I.M. Postor
    Replies:
    2
    Views:
    588
    I.M. Postor
    Sep 27, 2006
Loading...

Share This Page