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

RE: Creating a heirarchal unordered list from flat fil

Subject: RE: Creating a heirarchal unordered list from flat file
From: "Clapham, Paul" <pclapham@xxxxxxxxxxxxx>
Date: Thu, 25 Jan 2001 13:10:19 -0800
xsl create an ordered list
Let me just provide the framework, and you can implement it in XSL:

You need a recursive template called something like
"OutputNodeAndItsChildren".  Its implementation, when called with a node as
parameter, is:
  - output the node header
  - identify the node's children
  - for each of those children, call "OutputNodeAndItsChildren" with the
child as parameter.

Then your processing consists of only this:
  - identify the root node (parentID="0" perhaps?)
  - call "OutputNodeAndItsChildren" with the root node as parameter.

That's it.
PC2

-----Original Message-----
From: David Marsh [mailto:DMarsh@xxxxxxxxxx]
Sent: January 25, 2001 12:46
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Creating a heirarchal unordered list from flat file


I'm trying to create a heiarchal Ordered list from an XML file gererated
from SQL server.  The XML file is a flat representation of heirarchal data.
It looks like this:

<Root>
  <Groups GroupID="1" Name="Group1" ParentID="0">
  <Groups GroupID="2" Name="Group2" ParentID="1">
  <Groups GroupID="3" Name="Group3" ParentID="1">
  <Groups GroupID="4" Name="Group4" ParentID="1">
  <Groups GroupID="5" Name="Group5" ParentID="2">
  <Groups GroupID="6" Name="Group6" ParentID="2">
  <Groups GroupID="7" Name="Group7" ParentID="3">
  <Groups GroupID="8" Name="Group8" ParentID="3">
  <Groups GroupID="9" Name="Group9" ParentID="4">
  <Groups GroupID="10" Name="Group10" ParentID="5">
  <Groups GroupID="11" Name="Group11" ParentID="5">
  <Groups GroupID="12" Name="Group12" ParentID="6">
  <Groups GroupID="13" Name="Group13" ParentID="8">
  <Groups GroupID="14" Name="Group14" ParentID="8">
  <Groups GroupID="15" Name="Group15" ParentID="9">
  <Groups GroupID="16" Name="Group16" ParentID="10">
  <Groups GroupID="17" Name="Group17" ParentID="10">
  <Groups GroupID="18" Name="Group18" ParentID="16">
  <Groups GroupID="19" Name="Group19" ParentID="18">
  <Groups GroupID="20" Name="Group20" ParentID="19">
  ...
<Root>

The groups list will grow over time.
I want to transform it into an HTML document to an Unordered list that will
show the heirarchical structore of the file.  
Example:

* Group1
      * Group2
            * Group5
                  * Group10
                        * Group16
                              * Group18
                                    * Group19
                                          * Group20
                        * Group17
                  * Group11
            * Group6
                  * Group12
      * Group3
            * Group7
            * Group8
                  * Group13
                  * Group14         
      * Group4
            * Group9
                  * Group15

Is there an easy way to do this with XSL.  I'm new at this and I'm kind of
stumped right now.



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

 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.