xsl-list
[Top] [All Lists]

Convert sequence of elements to nested structure

2004-12-24 01:56:57
Hi,

This is no doubt an elementary question but I need to convert a sequence 
of elements of the same name like this:

<a>content1</a>
<note>content2</note>
<note>content3</note>
<note>content4</note>
<b>content5</b>

into a nested structure like this:

<a>content1</a>
<note>content2
     <cont>content3</cont>
     <cont>content4</cont>
</note>
<b>content5</b>

In other words, if there are consecutive <note> elements, they should be 
combined into one <note> element with the 2nd, 3rd and subsequent lines 
expressed as <cont> (continuation line) elements within the <note> element.

I can't quite see how to do this by recursion.

Thanks for your help

Rowan

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>