XSLT Newbie: grouping

P

petr.simek

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top