Subject: Re: RE: [xsl] Filtering elements of a tree From: "william locksman" <vsd18@xxxxxxxxxxxxxx> Date: 8 May 2002 13:44:48 -0000 |
Heppa,
> I want to select the element artist with id=7 and its parent,
> grand parent and so on.
> After transformation the xml should look like this-
>
> <TreeNode id="5" Text="music">
> <TreeNode id="6" Text="blues">
> <TreeNode id="7" Text="bb king"/>
> </TreeNode>
> <TreeNode id="6" Text="jazz">
> <TreeNode id="11" Text="bebop">
> <TreeNode id="7" Text="charlie parker"/>
> </TreeNode>
> <TreeNode id="7" Text="miles davis"/>
> </TreeNode>
> </TreeNode>
<xsl:template match="*">
<TreeNode>
<xsl:copy-of select="@*" />
<xsl:apply-templates select="*[@id = '7' or descendant::*/@id = '7']"/>
</TreeNode>
</xsl:template>
There are better solutions,
Santtu
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Filtering elements of a t, Jarno . Elovirta | Thread | [xsl] xsl:sort and datatypes, Ernst Wolthaus |
Re: [xsl] following-sibling or grou, Steve Rosenberry | Date | RE: [xsl] Generic Lookup (Element M, Faroukh Fekravar |
Month |