xsl-list
[Top] [All Lists]

[xsl] NaN

2008-09-09 02:27:30
XSLT: Version 1.0
Platform: Windows XP 

XML:
<Charge Id="77" Amount="139.97" CurrCode="EUR" Type="5" PT="P"/>
<SAPCreditItem CreditDate="20080520" CreditAmount=""/>

XSL:
<xsl:variable name="total" select="Charge[(_at_)Id='77' and @Type='5' 
and  (_at_)PT='P']/@Amount + SAPCreditItem/@CreditAmount"/>

Result: <xsl:value-of select="$total"/>

I tried with, <xsl:variable name="total" select="Charge[(_at_)Id='77' and 
@Type='5' and  (_at_)PT='P']/@Amount[number()=number()] + 
SAPCreditItem/@CreditAmount[number()=number()]"/>...But again the output is Nan.

How to avoid NaN. When the value is empty( CreditAmount="" ) as shown above.


Expected result: 139.97
Actual result: NaN



Regards,
Raja 







This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>