[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Flat -> Hierarchy
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|