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. Advertisements

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:
    708
    Christian Ludwig
    Nov 26, 2003
  2. Kevin Brown
    Replies:
    3
    Views:
    767
    Kevin Brown
    Aug 28, 2004
  3. Graham

    Help Grouping/Counting XSLT

    Graham, Sep 17, 2004, in forum: XML
    Replies:
    3
    Views:
    762
    =?ISO-8859-1?Q?J=FCrgen_Kahrs?=
    Sep 17, 2004
  4. Jody Greening
    Replies:
    5
    Views:
    852
    Jody Greening
    Jan 6, 2005
  5. Jody Greening
    Replies:
    0
    Views:
    441
    Jody Greening
    Jan 6, 2005
  6. Per Jørgen Vigdal

    Help on xslt - grouping

    Per Jørgen Vigdal, May 19, 2005, in forum: XML
    Replies:
    6
    Views:
    694
    Dimitre Novatchev
    May 20, 2005
  7. Mark
    Replies:
    1
    Views:
    474
    Janwillem Borleffs
    Aug 18, 2005
  8. I.M. Postor
    Replies:
    2
    Views:
    739
    I.M. Postor
    Sep 27, 2006
Loading...