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

Flat -> Hierarchy

Subject: Flat -> Hierarchy
From: Dongling Ding <dling61@xxxxxxxxx>
Date: Wed, 28 May 2003 15:45:21 -0700 (PDT)
define flat structure
Hi,


I think there were some discussion about this topic
already. But my case is a little different from
others. I have a flat structure that need to be
converted into a hierarchy based on another set of
elements that define the relationship between members.


I tried to use recursive and xsl:key methods and it
seems like both of the two methods couldn't solve the
problem.

I am wondering if anyone has an idea on this
particular case. Any help would be very appreciated!


Input:
-----------------------------------------------------
<Members>
		<Member>
			<Label>parent</Label>
			<Description>r1</Description>
		</Member>
		<Member>
			<Label>firstchild</Label>
			<Description>r2</Description>
		</Member>
		<Member>
			<Label>secondchild</Label>
			<Description>r3</Description>
		</Member>
		<Member>
			<Label>firstgrandchild</Label>
			<Description>r3</Description>
		</Member>
</Members>
<hierarchy>
		<node>
			<parent>parent</parent>
			<child>firstchild</child>
		</node>
		<node>
			<parent>parent</parent>
			<child>secondchild</child>
		</node>
		<node>
			<parent>parent</parent>
			<child>secondchild</child>
		</node>
		<node>
			<parent>secondchild</parent>
			<child>firstgrandchild</child>
		</node>
</hierarchy>
------------------------------------------------------

Output:
----------------------------------------------------
<Members>




__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

 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.