|
Subject: Re: [xsl] Node selection based on parent attribute From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 30 Aug 2002 12:24:31 -0400 |
<xsl:template match="menu">
<xsl:if select="ancestor::menu[@id=$id']">
<xsl:value-of select="@id"/>
<!-- copies out this menu's @id if it has an ancestor
menu with @id = $id -->
</xsl:if>
<xsl:apply-templates/>
<!-- continues the tree traversal in case there are any below -->
</xsl:template>Cheers, Wendell
Thanks for that.
Would there be an easy way of making that recursive. So if there were sub/sub nodes under <menu id=6>, ie
<menu id=6>
<menu id=8>
<menu id=9/>
<menu id=10/>... and so on
</menu>
</menu>
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Node selection based on p, katharine wykes | Thread | Re: Re: [xsl] Node selection based , ashu t |
| Re: [xsl] Node selection based on p, katharine wykes | Date | [xsl] If nodeset does NOT include, Thomas Hartung |
| Month |