This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xsl: variable problem


I mistyped the function of calcTot(s).  The function look like below...But
still I have problem of accessing the variable in javascript

function calcTot(s)
{
outStdAmt = outStdAmt - s ;
return outStdAmt


----- Original Message -----
From: "Gitanjali" <narsu@gitanjali.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Wednesday, May 23, 2001 5:36 AM
Subject: [xsl] xsl: variable problem


> 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
>
>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]