Grouping neighboring elements with xsl

K

kcwolle

Hello,
I have an XSL stylesheet problem.
I want to group neighboring elements by a surrounding hierarchical
element, for example all neighboring div Elements with attribute class
equals 1
Source:
<p>text</p>
<p>text</p>
<div class="1">text1</div>
<div class="1">text2</div>
<p>text</p>
<p>text</p>
<div class="1">text1</div>
<div class="1">text2</div>
<div class="1">text3</div>
<p>text</p>

Desired Output:
<p>text</p>
<p>text</p>
<div class="1">
<p>text1</p>
<p>text2</p>
</div>
<p>text</p>
<p>text</p>
<div class="1">
<p>text1</p>
<p>text2</p>
<p>text3</p>
</div>
<p>text</p>

Can anybody help me to solve this problem?

Yours

Wolfgang
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top