This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: making calculations in XSL
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: making calculations in XSL
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Wed, 31 May 2000 17:19:40 +0100
- Reply-To: xsl-list at mulberrytech dot com
> <?xml version="1.0">
> <startmeup>
> <number>1</number>
> <number>2</number>
> <number>...</number>
> </startmeup>
>
> <xsl:template match="startmeup">
> Total is: <xsl:value-of select="sum(//number)"/>
> </xsl:template>
>
>
> *crying* it just keeps on giving me 0 :(
1. Which XSLT processor are you using? At this stage it's usually worth
trying it on more than one.
2. Does your XML document really have a "..." in? If any of the <number>
elements is not a number, the result of the sum() function should be NaN,
not zero.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list