Hi I have a XML below
<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
<siteMapNode id="tcm:11-5821-64"
parentid="tcm:11-5-4"
depth="0"
url="/"
title="Home"
showLeftNav="true"
page_type="false"
showSecureContent="false"
navOrderSGTitle="Root"
externalURL=""
target="_self"
accessRight="" />
<siteMapNode id="tcm:11-577-64"
parentid="tcm:11-149-4"
depth="1"
url="/dentists"
title="Dentists"
showLeftNav="true"
page_type="true"
showSecureContent="false"
navOrderSGTitle="010Dentists"
externalURL=""
target="_self"
accessRight="" />
<siteMapNode id="tcm:11-164-4"
parentid="tcm:11-164-4"
depth="2"
url="/dentists/mybda"
title="My BDA"
showLeftNav="true"
page_type="false"
showSecureContent="true"
navOrderSGTitle="010My BDA"
externalURL="/MyBDA/index.aspx"
target="_self"
accessRight="Member Only" />
</siteMap>
and the xslt used for formatting is here:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:param name="currentpageid"></xsl:param>
<xsl:param name="securecontent"></xsl:param>
<xsl:param name="maxdepth"></xsl:param>
<xsl:param name="ismember"></xsl:param>
<xsl:template match="/">
<div id="contentleft">
<xsl:variable name="varcheckurl" select="//siteMapNode[@id=$currentpageid]/@url"/>
<xsl:choose>
<xsl:when test="contains($varcheckurl,'.aspx')">
<xsl:variable name="parentnode" select="//siteMapNode[@id=$currentpageid]/parent::*"/>
<xsl:variable name="parentpageid" select="$parentnode/@id"/>
<xsl:if test="//siteMapNode[@id=$parentpageid]/@depth > 0">
<xsl:attribute name="class">cont-top</xsl:attribute>
<h2>
<xsl:value-of select="//siteMapNode[@id=$parentpageid]/@title"/>
</h2>
</xsl:if>
<div id="contentNav" class="contentnav-home">
<ul>
<xsl:apply-templates select="//siteMapNode[@id=$parentpageid]/siteMapNode[@showLeftNav='true']" >
<xsl:sort select="@navOrderSGTitle" order="ascending"/>
<xsl:with-param name="varpageid" select="$parentpageid"/>
</xsl:apply-templates>
</ul>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:if test="//siteMapNode[@id=$currentpageid]/@depth > 0">
<xsl:attribute name="class">cont-top</xsl:attribute>
<h2>
<xsl:value-of select="//siteMapNode[@id=$currentpageid]/@title"/>
</h2>
</xsl:if>
<div id="contentNav" class="contentnav-home">
<ul>
<xsl:apply-templates select="//siteMapNode[@id=$currentpageid]/siteMapNode[@showLeftNav='true']" >
<xsl:sort select="@navOrderSGTitle" order="ascending"/>
<xsl:with-param name="varpageid" select="$currentpageid"/>
</xsl:apply-templates>
</ul>
</div>
</xsl:otherwise>
</xsl:choose>
</div>
<xsl:choose>
<xsl:when test="@showSecureContent='true' and @accessRight='Member Only'">
<xsl:if test="$securecontent='true' and $ismember='true'">
<li>
<xsl:if test="count(.//siteMapNode[@id=$varpageid]) > 0 or @id=$currentpageid">
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<a href="#">
<xsl:attribute name="title">
<xsl:value-of select="@title"/>
</xsl:attribute>
<xsl:if test="@externalURL='' and @target='_self'">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL='' and @target='_blank'">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL!=''and @target='_self'">
<xsl:attribute name="href">
<xsl:value-of select="@externalURL"/>
</xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL!=''and @target='_blank'">
<xsl:attribute name="href">
<xsl:value-of select="@externalURL"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="@title"/>
</a>
</li>
</xsl:if>
</xsl:when>
<xsl:when test="@showSecureContent='true' and @accessRight!='Member Only'">
<xsl:if test="$securecontent='true'">
<li>
<xsl:if test="count(.//siteMapNode[@id=$varpageid]) > 0 or @id=$currentpageid">
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<a href="#">
<xsl:attribute name="title">
<xsl:value-of select="@title"/>
</xsl:attribute>
<xsl:if test="@externalURL='' and @target='_self'">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL='' and @target='_blank'">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL!=''and @target='_self'">
<xsl:attribute name="href">
<xsl:value-of select="@externalURL"/>
</xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL!=''and @target='_blank'">
<xsl:attribute name="href">
<xsl:value-of select="@externalURL"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="@title"/>
</a>
</li>
</xsl:if>
</xsl:when>
<xsl:when test="@showSecureContent!='true' and @accessRight='Member Only'">
<xsl:if test="$ismember='true'">
<li>
<xsl:if test="count(.//siteMapNode[@id=$varpageid]) > 0 or @id=$currentpageid">
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<a href="#">
<xsl:attribute name="title">
<xsl:value-of select="@title"/>
</xsl:attribute>
<xsl:if test="@externalURL='' and @target='_self'">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL='' and @target='_blank'">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL!=''and @target='_self'">
<xsl:attribute name="href">
<xsl:value-of select="@externalURL"/>
</xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL!=''and @target='_blank'">
<xsl:attribute name="href">
<xsl:value-of select="@externalURL"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="@title"/>
</a>
</li>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<li>
<xsl:if test="count(.//siteMapNode[@id=$varpageid]) > 0 or @id=$currentpageid">
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<a href="#">
<xsl:attribute name="title">
<xsl:value-of select="@title"/>
</xsl:attribute>
<xsl:if test="@externalURL='' and @target='_self'">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL='' and @target='_blank'">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL!=''and @target='_self'">
<xsl:attribute name="href">
<xsl:value-of select="@externalURL"/>
</xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
</xsl:if>
<xsl:if test="@externalURL!=''and @target='_blank'">
<xsl:attribute name="href">
<xsl:value-of select="@externalURL"/>
</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="@title"/>
</a>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Problem is that I want if page_type=false in XML then it should have class="active" and should come in left navigation part.