[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] Filtering nodes
Subject: [xsl] Filtering nodes From: "Suresh Babu" <sbkoya21@xxxxxxxx> Date: Mon, 13 May 2002 02:20:06 +0530 |
Hello group, I have a simple XML like <Root> <Record Name="R1"> <Record Name="L1"> <Leaf Name="text"/> </Record> <Record> <Record Name="L2"> <Leaf Name="text"/> </Record> </Record> <Record Name="R2"> <Record> <Record> <Record> <Record Name="LL1"> <Leaf Name="text"/> </Record> <Record Name="LL2"> <Leaf Name="text"/> </Record> </Record> </Record> </Record> </Record> </Root> To transform it to a simple structure like <Record Name="R1"> <Leaf Name="L1"/> <Leaf Name="L2"/> <Record Name="R2> <Leaf Name="LL1"/> <Leaf Name="LL2"/> </Record> </Record> Could any one suggest ways to filter the dummy record nodes under R1 and R2 and display the Leaf nodes under R1 and R2. For displaying the field nodes under a specific record I used the keys function to select the "Record" elements with a "Leaf" element and having attribute "Name" value "text" as follows: <xsl:key name="leaf-nodes" match="Record" use="Leaf/@Name"/> This is fine for R2 but fails for R1 in which case it is diplaying all the fields in R2 also. Could some correct the keys expression/suggest a better way for doing this. Thanks and regards, Suresh XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] need an extra pair or two, Randall Gremillion | Thread | Re: [xsl] Filtering nodes, Joerg Heinicke |
Re: [xsl] XSLT/XPath 2.0 (was "Iden, Dan Holmsand | Date | [xsl] limitations of xsl:comment, Ben Leighton |
Month |
Keywords