[xsl] xsl: variable problem

Subject: [xsl] xsl: variable problem
From: "Gitanjali" <narsu@xxxxxxxxxxxxx>
Date: Wed, 23 May 2001 05:36:52 -0400
All

Could you please tell me the problem with my xsl.  When I passed the
variable to my javascript function, it is not passing whatever I'm
expecting.

Thanks

Narsu





<?xml version="1.0" ?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";

xmlns:msxsl="urn:schemas-microsoft-com:xslt"

xmlns:user="http://mycompany.com/mynamespace";

version="1.0">

<xsl:param name="oamt" select="100"/>

<xsl:param name="id" select="1" />

<xsl:output method="html" indent="no" />



<msxsl:script language="JavaScript" implements-prefix="user">

var outStdAmt = 0;

function setAmt(s)

{

outStdAmt = s ;

return outStdAmt ;

}

function calcTot(s)

{

outStdAmt = outStdAmt - s.nodeValue ;

return outStdAmt ;

}

</msxsl:script>

<xsl:template match="DATA">

<xsl:apply-templates select="RNS/RN[@ID=$id]" />

</xsl:template>

<xsl:template match="RNS/RN">

<table border="1">

<tr bgcolor="Silver">

<td>OutStanding Amount</td>

<td>Credit Amount</td>

<td>Approved By</td>

</tr>

<xsl:for-each select="CREDITS/CREDIT">

<tr>

<xsl:variable name="credAmt"><xsl:value-of select="AMOUNT"/></xsl:variable>

<td>

<xsl:choose>

<xsl:when test="position() = 1">

<xsl:value-of select="$oamt"/>

</xsl:when>

<xsl:otherwise>

<xsl:value-of select="user:calcTot({$credAmt})"/>

</xsl:otherwise>

</xsl:choose>

</td>

<td>

<xsl:value-of select="AMOUNT"/>

</td>

<td>

<xsl:value-of select="APPROVED"/>

</td>

</tr>

</xsl:for-each>

</table>

</xsl:template>

</xsl:stylesheet>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread