This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl: variable problem
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] xsl: variable problem
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Wed, 23 May 2001 11:05:52 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> 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.
>
> <xsl:value-of select="user:calcTot({$credAmt})"/>
>
This is a syntax error, it shouldn't execute at all. Curly braces are not
allowed within an XPath expression.
In general when calling JavaScript you need to take care to pass the right
type of value for the Javascript function. If it's expecting a node-set,
pass it a node-set; if it's expecting a string, use the XPath string()
function to convert the value to a string.
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list