[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl: variable problem

Subject: Re: xsl: variable problem
From: "Gitanjali" <narsu@xxxxxxxxxxxxx>
Date: Wed, 23 May 2001 06:02:00 -0400
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@xxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, May 23, 2001 5:36 AM
Subject:  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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.