Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treewalking in XSLT

Status
Not open for further replies.

CassidyHunt

IS-IT--Management
Jan 7, 2004
688
US
I am struggling with an xml file that has a parent child relationship transforming it to work in a treeview control I am making. The resultset I am dealing with may have more data than I need so I need to simulate Oracles Start With Connect by to be able to walk the tree.

The basic idea of what I am looking for is to be able to pass a parameter of parent id and child id and recursivly walk the tree. That is fairly straight forward and I can get that far if I know what I am expecting. The part I am struggling with is I need to be able to dynamically expand data fields associated with the a particular node. The finished result would be something like this:

Code:
<treeview>
    <node id=0>
        <nodetext>root</nodetext>
        <data>
             <field1>This can be anything assigned</field1>
             <field2>This is also dynamic</field2>
             <field3>al;skdjf;alsd</field3>
        <data>
        <node id=2>
             <nodetext>Parent 1</nodetext>
             <data>
                  <field1>This can be anything assigned</field1>
                  <field2>This is also dynamic</field2>
                  <field3>al;skdjf;alsd</field3>
             <data>
       </node>
    </node>
</treeview>

Now the fields will always have the same number of fields for each result. i.e. if there are 3 fields for the root the rest of nodes much have 3 fields in the data section even if one is null. I do not know how to make that dynamic or handle the input of field names strictly within an XSLT file.

Any examples or help are appreciated.

Cassidy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top