I need to write an XSL that writes out an unordered HTML list for the section based on a parameter of the current page. So. If i'm on page with id="9" I need:
Subject: XSL help needed for recursive nested list menu Author:Minollo I. Date:27 Feb 2006 09:59 AM
Julian,
I'm not sure I understand your constraints.
Does something like this work any better for you?
<xsl:choose>
<xsl:when test="descendant-or-self::page[@id=$pageId]">
<li class="parent">
<xsl:value-of select="@name"/>
<xsl:apply-templates select="page"/>
</li>
</xsl:when>
<xsl:when test="preceding-sibling::page/page[@id=$pageId] or following-sibling::page/page[@id=$pageId]">
<li class="parent">
<xsl:value-of select="@name"/>
<xsl:apply-templates select="page"/>
</li>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="page"/>
</xsl:otherwise>
</xsl:choose>
From what you wrote, I couldn't understand what you are try to show/hide when specifying a specific page id, and if what you want to display is a flat or hierarchical list.