[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Nested list, from flat to structure

Subject: Nested list, from flat to structure
From: "Kjellaug Johansen" <kjellaug.johansen@xxxxx>
Date: Tue, 8 Feb 2011 15:39:13 +0100
 Nested list
I have this input-XML:

<lnum1>list 1 A</lnum1>
<lp1>list 1 A paragraph</lp1>
<lnum1>list 1 B</lnum1>
<lnum2>list 2 A</lnum2>
<lnum2>list 2 B</lnum2>
<lp2>list 2 paragraph</lp2>
<lnum2>list 2 C</lnum2>
<lnum1>list 1 C</lnum1>

And I want this output:

		<p>list 1 A</p>
		<p>list 1 A paragraph</p>
		<p>list 1 B</p>
				<p>list 2 A</p>
				<p>list 2 B</p>
				<p>list 2 paragraph</p>
				<p>list 2 C</p>
		<p>list 1 C</p>

I've tried many different approches. I did come up with a solution for
all the elements starting with 'lnum', it worked well, but the elements
with 'lp' did confuse me. Anyone with an advice or solution?

Kjellaug Johansen.

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.