I have a question that caused me a terrible headache. Please help me. Entrance:
<body> <p class="section"> section 1 </p> <p class="code"> some code </p> <p class="code"> following code </p> <p class="code"> following code </p> <p class="section"> section 2 </p> <p class="code"> other code </p> <p class="code"> following code </p> <p class="code"> following code </p> <p class="section"> section 3 </p> <p class="code"> still other code </p> <p class="code"> following </p> <p class="code"> following </p> </body>
The result that I would like:
<body> <p class="section"> section 1 </p> <pre> some code following code following code </pre> <p class="section"> section 2 </p> <pre> other code following code following code </pre> <p class="section"> section 3 </p> <pre> still other code following following </pre> </body>
The problem is to collapse the <pre> to all adjacent <p class="code"> tags. Don't find a way to do this with XSLT. Do you think there is a solution?
source share