I have an xsl which looks something like:
<xsl:param name="relativeURL"/>
<xsl:param name="isPersonalPage" />
<xsl:template match="/">
<xsl:call-template name="main_level" >
<xsl:with-param name="urlMatched" select="siteMap/siteMapNode/siteMapNode/@url= $relativeURL" />
</xsl:call-template>
</xsl:template>
<xsl:template name="main_level" match="/">
<div>
<xsl:param name="urlMatched" />
<xsl:for-each select="siteMap/siteMapNode/siteMapNode">
<xsl:choose>
<xsl:when test="(@url = $relativeURL)">
<a class="top_link active">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:value-of select="@topNavTitle"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="($isPersonalPage = 'true') and (!($urlMatched))">
<a class="top_link active">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:value-of select="@topNavTitle"/>
</a>
</xsl:when>
<xsl:otherwise>
<a class="top_link">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
<xsl:value-of select="@topNavTitle"/>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
So, basically i need to loop through the node and see if the url attribute of any node matches with a specific URL. If so set value of a variable to something else to something else. Then in the called template "main_nav" I wish to do something based on the value of "urlMatched" variable. But i am not sure I can alter value of a variable in between or not. Can anyone help me with any solution to this problem?