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

RE: Nested XML Tree View

Subject: RE: Nested XML Tree View
From: "Andy J. Cupp" <acupp@xxxxxxxxxxxxxxx>
Date: Thu, 16 Jan 2003 13:37:38 -0600
xsl for nested xml
Create a template that matches all the elements you want to display.  Inside that template, take a count of all the ancestors of the current element.  You can use that count to know how many spaces to "tab over" on every line.  Then create a <div> element that displays the element's name and value, and use the <div>'s attributes to accomplish the "tabbing over".

Instead of counting the ancestors, you could also send a param to each successive template that matches an element, like this:

<xsl:apply-templates select="node()">
	<xsl:with-param name="currentDepth" select="$currentDepth + 1"/>
</xsl:apply-templates>

That way, $currentDepth will always contain how many levels down you are in the xml structure.

If you need help with any of the details, please let me know.

Hope I was some help,
Andy

-----Original Message-----
How can I achieve the following HTML output displaying the hierachy:

Group: MyGroup
	Table: Plate
		Variable: Max_Response
		Table: Well
			Variable: Well_ID

Any guidance at all would be appreciated.

Thanks in advance



_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


 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.