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

XSLT for unflattening a tree?

Subject: XSLT for unflattening a tree?
From: Stuart Hungerford <stuart.hungerford@xxxxxxxxxxxxx>
Date: Fri, 07 Apr 2000 09:48:23 +1000
xslt h1 h2 h3 nested
Hi all,

I've been working with a series of XML documents that effectively represent
"flattened" trees. Instead of using nested elements for each level of the tree,
they use empty header elements that indicate the tree level:

        <h1/>
            <h2/>
                <content .../>
                <h3/>
                    <content .../>
                <h3/>
                    <content .../>
            <h2/>
                  ...
         <h1/>
                 ...

My question is what would be involved in using XSLT to convert that
structure to a nested element structure:

           <h1>
               <h2>
                   <content .../>
                   <h3>
                        <content .../>
                   </h3>
                    <h3>
                          ...
                    </h3>
                ...
               </h2>
            </h1>

In one sense I'd like to maintain a stack of levels, but that's not necessarily
the XSLT "way".  Am I barking up the wrong tree to do this kind of thing
in XSLT?

Cheers,

Stu


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.