<xsl:choose>
<xsl:when test="$cty='LOHNSTD'">
<xsl:variable name="sum" select="$sum + $amt"/>
</xsl:when>
<xsl:when test="$cty='REGPAY'">
<xsl:variable name="sum1">
<xsl:value-of select="$sum1 + $amt"/>
</xsl:variable>
</xsl:when>
</xsl:choose>
In the above code it gives me warning message saying variables sum and sum1 are not declared. amt and cty are parameters being passed to this template. Can any one help me in doing the summation based on different category codes?