|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Walking a tree
Hi Marcus,
Here's a solution that uses apply-templates with a mode (mode="pageNav") instead of call-template. I'm assuming that you can pass the name of the clicked node in a global param: <xsl:param name="target" select="'node23'"/> Then, instead of <xsl:call-template name="pageNav"><xsl:with-param.../xsl:call-template> <xsl:apply-templates select="node" mode="pageNav"/> and this template: <xsl:template match="node | leaf" mode="pageNav">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="node" mode="pageNav"/>
<xsl:if test="@name = $target">
<xsl:apply-templates select="leaf" mode="pageNav"/>
</xsl:if>
</xsl:copy>
</xsl:template>output: <node>
<node name="node1"/>
<node name="node2">
<node name="node22"/>
<node name="node23">
<leaf name="leaf231"/>
<leaf name="leaf232"/>
</node>
<node name="node24"/>
</node>
</node>Cheers, Anton Marcus Andersson wrote: I'm trying to walk a tree with the following structure (more or less):
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








