Subject: [xsl] Flat -> Hierarchy From: Dongling Ding <dling61@xxxxxxxxx> Date: Wed, 28 May 2003 15:45:20 -0700 (PDT) |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Referencing a external sc, John Reid | Thread | [xsl] Flat -> Hierarchy, Dongling Ding |
[xsl] RE: copying a node structure , John Reid | Date | [xsl] Flat -> Hierarchy, Dongling Ding |
Month |