Click here to Skip to main content
16,021,041 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="xml" indent="yes" encoding="utf-8"/>
    <!-- Find the root node called Menus
      and call MenuListing for its children -->
    <xsl:template match="/Menus">
        <MenuItems>
            <xsl:call-template name="MenuListing" />
        </MenuItems>
      <xsl:for-each select="Menus">
        <xsl:choose>
          <xsl:when test="Name!=''">
            <xsl:text>HomePage</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>HomePage</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>

    </xsl:template>
    <!-- Allow for recusive child node processing -->
    <xsl:template name="MenuListing">
        <xsl:apply-templates select="Menu" />
    </xsl:template>
    <xsl:template match="Menu">
 <MenuItem>
            <!-- Convert Menu child elements to MenuItem attributes -->
            <xsl:attribute name="MenuText">
                <xsl:value-of select="Name"/>
            </xsl:attribute>
   <xsl:attribute name="tooltip">
                <xsl:value-of select="ToolTip"/>
            </xsl:attribute>
   <xsl:attribute name="destUrl">
     <xsl:value-of select="NavigateUrl"/>
   </xsl:attribute>
            <!-- Call MenuListing if there are child Menu nodes -->
            <xsl:if test="count(Menu) > 0">
                <xsl:call-template name="MenuListing" />
            </xsl:if>
        </MenuItem>
      <!--</xsl:for-each>-->
    </xsl:template>
</xsl:stylesheet>



Or just give the idea when i am clicking on menu just it change lable through XSLT
Posted
Comments
[no name] 7-Jul-11 8:08am    
Please elaborate on the usage for this. Is it in a Windows app, Web app or something else? Giving some context will help get a better answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900