XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Cassidy HuntSubject: Recursion Help
Author: Cassidy Hunt
Date: 24 Aug 2006 02:41 PM
I am trying to make a treeview that I do not know how many levels deep it will go. The out put needs to look something like this:

1
2
3
4
5
6
7
8



of course it won't be in order like that but that is the jist. I attached the files below that I am working with. Any help is greatly appreciated.

Thanks

Cassidy Hunt


Documentbillingreport.xsl
Transformation File

Documentcat_temp.xml
Data to be recursivly transformed.

Posttop
James DurningSubject: Recursion Help
Author: James Durning
Date: 24 Aug 2006 04:14 PM
Warning, this forum trims spaces.

Inside your main template, get all the 1st level elements
<xsl:template match="/DocumentElement">
<root>
<xsl:apply-templates select="work_order[not(PARENT_KEY)]"/>
</root>
</xsl:template>

Then inside each of those elements, get all of the children elements like so:
<xsl:template match="work_order">
<xsl:variable name="id" select="UNIQUE_KEY"/>
<xsl:apply-templates select="/DocumentElement/work_order[PARENT_KEY = $id]"/>
</xsl:template>

Fill in your output details inside these 2 templates.
Hope this helps.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.