Problem in passing parameter to xslt template
Hi Guys,
I am using following code to convert an XML into XSLT. As one could see I am usinf a template foo recursiveky but I am not able to change value of parameter bid. Could anybody spot the problem?
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template name = "foo" match ="/">
<xsl:param name="bid" select="'0'" />
<table width = "100%">
<xsl:for-each select="orgHierarchy/emp">
<xsl:variable name = "CURRBOSSID"><xsl:value-of select="@bossID"/></xsl:variable>
<xsl:if test ="$CURRBOSSID = $bid">
<tr>
<td><xsl:value-of select = "$bid"/>^^<xsl:value-of select = "@empID"/>^^<xsl:value-of select="@empName" /></td>
<td>
<xsl:call-template name="foo">
<xsl:with-param name="bid" select = "@empID"/>
</xsl:call-template>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Regards
Uttam
|