dynamic HREF attribute by XSLT

Posted by ofortuna on Stack Overflow See other posts from Stack Overflow or by ofortuna
Published on 2012-06-11T08:53:43Z Indexed on 2012/06/11 10:40 UTC
Read the original article Hit count: 177

Filed under:
|
|

Can anyone plese advice how I can have dynamic HREF attribute in the place of http://abc.com by XSLT in following code snippet?

<xsl:for-each select="MenuItems/mainmenu">
<a href="http://abc.com">
<span><xsl:value-of select="menuName"/></span>
</a>   
    </xsl:for-each>

sample xml

<MenuItems>
<mainmenu>
    <menuID>1</menuID>
    <menuName>Home</menuName>
    <menuLink>http://aaa.com</menuLink>
        <subMenuList>
            <menuID>2</menuID>
            <menuName>Home</menuName>
            <menuLink>http://a1.com</menuLink>
        </subMenuList>
        <subMenuList>
            <menuID>3</menuID>
            <menuName>List of RCCs</menuName>
            <menuLink>http://a2.com</menuLink>
        </subMenuList>
        <subMenuList>
        <menuID>4</menuID>
        <menuName>Turnover Workout</menuName>
        <menuLink>http://a3.com</menuLink>
        </subMenuList>
</mainmenu>
<MenuItems>

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xslt