I'm trying to produce a tree of data that looks like this:
- root
- 1stGenChild1
- 2ndGenChild1
- 2ndGenChild2
- 1stGenChild2
- 1stGenChild1
and so produce the code as follows:
<ul>
<li>root</li>
<ul>
<li>1stGenChild1</li>
<ul>
<li>2ndGenChild1</li>
<li>2ndGenChild2</li>
</ul>
<li>1stGenChild2</li>
</ul>
where my data is in the form:
<XML_FILTER>
<XPATH @xpath="root/1stGenChild1" />
<XPATH @xpath="root/1stGenChild1/2ndGenChild1" />
<XPATH @xpath="root/1stGenChild1/2ndGenChild2" />
<XPATH @xpath="root/1stGenChild2" />
</XML_FILTER>
It would be relatively simple to produce this in XSLT2 with tokenise, but I cannot use XSLT2 for this as I am restricted to using only MSXML 6.0 by the system in use.
The biggest problem I've found is that the normal methods of doing this can't deal with the root never being explicitly stated in its own attribute, but I still need this node in the output.
How can I produce a tree for data which may have more child node levels? - ie. many more lists within lists than the example shown above.
Also does anyone know if there is a limit to the number of lists within lists before indentation is not rendered by browsers, as this will make the view useless.
Many thanks.