|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: tail recursion and NaN
Hi Susan,
If the operation is a simple sum, why not use the inherent XSLT function sum and let the XPath pick out the right nodes for you? BTW a number(.) also returns 'NaN' if the node's string value is nothing (""), so some of the tests you do are not necessary anyway (MK's XSLT Programmers Ref. 2nd. ed., p. 532). I would expect something like this to work: result = <xsl:value-of select="sum(nodeset-containing-prices[number(translate(.,'$',''))!='NaN'])"/> where nodeset-containing-prices should be exchanged with the nodeset you use in the $price parameter first time the template total_value is called. I hope this helps Regards, Ragulf Pickaxe :) From: "Susan Campbell" <SCampbell@xxxxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: tail recursion and NaN Date: Fri, 7 May 2004 08:59:19 -0400 _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








