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

need to write multiple branching tree hierarchies as

Subject: need to write multiple branching tree hierarchies as numbered lists
From: Mark Fletcher <dafletcha@xxxxxxxxx>
Date: Thu, 29 Mar 2007 09:44:29 -0700 (PDT)
 need to write multiple branching tree hierarchies as
I have a structure in which reflexive nested elements need to be 
represented as ordered siblings. To complicate matters, a parent
element can 
contain multiple children -- each with their own nested descendants.
   
I'm probably not explaining this very well, so here's an example:
   
  <wrapper>
    <step name="A">
      <step name="AA">
        <step name="AAA"/>
        <step name="AAB"/>
      </step>
      <step name="AB">
        <step name="ABA"/>
      </step>
    </step>
    <step name="B">
      <step name="BA"/>
    </step>
  </wrapper>
   
In my output, I need to represent the ancestry of each terminal step 
as a numbered list:
   
  1. A
  2. AA
  3. AAA
   
  1. A
  2. AA
  3. AAB
   
  1. A
  2. AB
  3. ABA
   
  1. B
  2. BA
   
My inclination is build the main loop on the terminal steps, ie. 
for-each select="//step[not(step)]". But I'm not sure where to go after
that, since climbing backward through parent::step will build the list
in reverse.  Perhaps storing the id of the terminal step and passing
that along to a recursive template that walks descendants of 
ancestor::step[1]?
   
(BTW, the name attribute is for demonstration only, I don't have an 
attribute that I can sort on.)
   
I'd appreciate any help!



 
____________________________________________________________________________________
We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

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-2011 All Rights Reserved.