A
Anthony
Hi all,
i have managed to create an asp.net menu using xml and xslt.. i am now
trying to highlite the selected path by sending in the path info and
hilite it using an xsl select choose function. My only problem now is
to highlight all parent nodes above the one selected. Does anyone have
any ideas as to achieve this..
XML DATA
..........................................................
<?xml version="1.0" ?>
<MenuData>
NEEDS TO BE HIGHLIGHTED <MenuGroup Menu="True" ID="About"
Label="About" URL="/1/about/" Image="about_thumb.jpg" Text="A history
of our its origins and pedigree">
FOUND AND HIGHLIGHTED <MenuItem Box="True" ID="About1"
Label="Introduction" URL="/1/about/introduction.aspx"
Image="about_intro_thumb.jpg" Text="A brief outline of the Group and
its composite parts"/>
</MenuGroup>
<MenuData>
...............................................
xslt:
-----------------------------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl
aram name="sectionID" />
<xsl
aram name="urlID" />
<xsl:template match="/MenuData/MenuGroup">
<xsl:if test="@ID=$sectionID">
<div class="divHeaderBlue">Sub Menu</div>
<div class="link-list">
<ul class="light">
<xsl:for-each select="MenuItem">
<xsl:choose>
<xsl:when test="@URL=$urlID">
<li class="blue">
<a>
<xsl:attribute name="href">
<xsl:value-of select="@URL" />
</xsl:attribute>
<xsl:value-of select="@Label" />
</a>
</li>
</xsl:when>
<xsl
therwise>
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="@URL" />
</xsl:attribute>
<xsl:value-of select="@Label" />
</a>
</li>
</xsl
therwise>
</xsl:choose>
</xsl:for-each>
</ul>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
i have managed to create an asp.net menu using xml and xslt.. i am now
trying to highlite the selected path by sending in the path info and
hilite it using an xsl select choose function. My only problem now is
to highlight all parent nodes above the one selected. Does anyone have
any ideas as to achieve this..
XML DATA
..........................................................
<?xml version="1.0" ?>
<MenuData>
NEEDS TO BE HIGHLIGHTED <MenuGroup Menu="True" ID="About"
Label="About" URL="/1/about/" Image="about_thumb.jpg" Text="A history
of our its origins and pedigree">
FOUND AND HIGHLIGHTED <MenuItem Box="True" ID="About1"
Label="Introduction" URL="/1/about/introduction.aspx"
Image="about_intro_thumb.jpg" Text="A brief outline of the Group and
its composite parts"/>
</MenuGroup>
<MenuData>
...............................................
xslt:
-----------------------------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl
<xsl
<xsl:template match="/MenuData/MenuGroup">
<xsl:if test="@ID=$sectionID">
<div class="divHeaderBlue">Sub Menu</div>
<div class="link-list">
<ul class="light">
<xsl:for-each select="MenuItem">
<xsl:choose>
<xsl:when test="@URL=$urlID">
<li class="blue">
<a>
<xsl:attribute name="href">
<xsl:value-of select="@URL" />
</xsl:attribute>
<xsl:value-of select="@Label" />
</a>
</li>
</xsl:when>
<xsl
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="@URL" />
</xsl:attribute>
<xsl:value-of select="@Label" />
</a>
</li>
</xsl
</xsl:choose>
</xsl:for-each>
</ul>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>