Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSLT Newbie: grouping

Reply
Thread Tools

XSLT Newbie: grouping

 
 
petr.simek@gmail.com
Guest
Posts: n/a
 
      08-25-2006
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

 
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
Transforming with XSLT, Grouping elements until difference found. Jody Greening XML 5 01-06-2005 06:52 PM
Transforming with XSLT, Grouping elements until difference found. Jody Greening XML 0 01-06-2005 04:07 PM
Help Grouping/Counting XSLT Graham XML 3 09-17-2004 06:20 PM
XSLT XML-HTML Transformation using grouping Kevin Brown XML 3 08-28-2004 03:39 PM
XSLT: sorting and grouping Christian Ludwig XML 2 11-26-2003 10:37 AM



Advertisments