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

Re: building hierarchy from path string

Subject: Re: building hierarchy from path string
From: "John-Mason P. Shackelford" <john-mason@xxxxxxxxxxxxxxx>
Date: Wed, 05 Dec 2001 11:25:54 -0600
hierarchy data node path
Joshua, (& others!)

Thanks much! This gives me a good place to start.

I'd like to be able to handle path stings of arbitrary depth, so I'll try to modify your template to handle it. One approach would be to have a style sheet that generates another based on one look at the path. The two variables I must be perpared to handle are: (1) each level of depth is represented by a number of fixed within tree, but which may vary from tree to tree. (2) each tree has a specified depth which maybe obtained by dividing the path the by the number of characters representing each level. The path will always be the same length with in the tree, and (as you aptly detected) zeros always indicate that node is a parent for a given level. BTW this is a handy way to store & manipulate hierarchical data in a database--everybody's worst nightmare :).

I could pass the the info to the stylesheet by writing my xml this way:

<tree>
   <descriptor chars-per-tier="2" depth="3" />
   <node-list>
       <node depth="0" OID="1" name="Animals" path="100000" />
       <node depth="1" OID="2" name="Reptile" path="102000" />
       <node depth="2" OID="5" name="Snake" path="102010" />
       <node depth="2" OID="6" name="Crock" path="102020" />
       <node depth="2" OID="7" name="Gator" path="102030" />
       <node depth="1" OID="3" name="Bird" path="103000" />
       <node depth="1" OID="4" name="Mamal" path="103000" />
   </node-list>
</tree>

Thanks again, Joshua, for pointing me in the right direction with all of this. I'll crunch on it some and let you know what I come up with. Others--feel free to chime in!

John-Mason
--
http://john-mason.shackelford.org


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.