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

Re: Get NaN when adding

Subject: Re: Get NaN when adding
From: Markus Abt <abt@xxxxxxxx>
Date: Wed, 23 Jun 2004 16:18:33 +0200
xsl nan
Hello James,

I guess the problem is inside the orderlist.sum.edit2 template,
which you didn't show us. Check if it returns a number.

Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de


----------
Von: 	James Steven
Gesendet: 	Dienstag, 22. Juni 2004 17:44
An: 	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: 	 Get NaN when adding 

Hello
Using the xml and xsl below I have added b/c/data to b/d/data.  However when
I use the same method to add b/e/data (value of 0.00) to b/f/data (value of
0.00 also) I get NaN.  Does anyone have any ideas why I am getting this?
Thankyou very much for any help offered.


<xsl:template match="a">
 <xsl:call-template name="orderlist.sum.edit">
  <xsl:with-param name="set-of-order" select="b/c"/>
 </xsl:call-template>
</xsl:template>

<!-- ================================================================ --!>

<xsl:template name="orderlist.sum.edit">
 <xsl:param name="set-of-order"/>
  <xsl:variable name="sumorg">
   <xsl:call-template name="orderlist.sum">
    <xsl:with-param name="set-of-order" select="$set-of-order"/>
   </xsl:call-template>
  </xsl:variable>
 <xsl:value-of select='format-number($sumorg, "£###,###,##0.00")'/>
</xsl:template>

<xsl:template name="orderlist.sum">
  <xsl:param name="set-of-order"/>
  <xsl:variable name="var1">
   <xsl:call-template name="orderlist.sum.edit2">
    <xsl:with-param name="set-of-order" select="b/d"/>
   </xsl:call-template>
  </xsl:variable>
  <xsl:choose>
   <xsl:when test="$set-of-order">
   <xsl:variable name="first">
   <xsl:apply-templates select="$set-of-order[1]/data"/>
   </xsl:variable>
   <xsl:variable name="rest">
   <xsl:call-template name="orderlist.sum">
    <xsl:with-param name="set-of-order" select="$set-of-order[position() !=
1]"/>
   </xsl:call-template>
  </xsl:variable>
  <xsl:value-of select="$first + $rest + $var1"/>
 </xsl:when>
 <xsl:otherwise>0</xsl:otherwise>
 </xsl:choose>
</xsl:template>

<!-- 

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.