[xsl] NaN

Subject: [xsl] NaN
From: "Sathasivam, Elayaraja" <elayaraja.sathasivam@xxxxxxxxxxxxx>
Date: Tue, 9 Sep 2008 11:50:05 +0530
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[@Id='77' and @Type='5'
and  @PT='P']/@Amount + SAPCreditItem/@CreditAmount"/>

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

I tried with, <xsl:variable name="total" select="Charge[@Id='77' and @Type='5'
and  @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.

Current Thread