Subject: Re: Standard problem? From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 9 Oct 2000 14:33:39 GMT |
> This is, to every node I'd like to have > all its parents and their siblings, I'd also like to > have the node and it's siblings and the direct > childs of the node. Isn't that just "I'd like to have all direct children of any ancestor. I think you want something like <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:strip-space elements="*"/> <xsl:output method="xml" indent="yes"/> <xsl:param name="thisid" select="'A1'"/> <xsl:template match="*"> <xsl:if test="../descendant-or-self::*[@id=$thisid]"> <xsl:copy> <xsl:copy-of select="@id"/> <xsl:apply-templates/> </xsl:copy> </xsl:if> </xsl:template> </xsl:stylesheet> <?xml version="1.0" encoding="utf-8"?> <x> <NODE id="A"> <NODE id="A1"/> <NODE id="A2"/> <NODE id="A3"> <NODE id="A3i"/> <NODE id="A3ii"/> </NODE> </NODE> <NODE id="B"/> <NODE id="C"/> </x> David XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Standard problem?, Nestel, Frank | Thread | RE: Standard problem?, Kay Michael |
Antwort: Re: Updated Benchmark Avai, v . rudowitsch | Date | Re: What's an "XML Fragment"?, John E. Simpson |
Month |