xsl-list
[Top] [All Lists]

RE: Compute sum of a computed node list

2004-05-05 16:09:41
-----Original Message-----
From: vsubramanian(_at_)xperts(_dot_)com 
[mailto:vsubramanian(_at_)xperts(_dot_)com]

Hi!

Here I am trying to compute the sum for the state
local salary which has some mathematical calculation involved.

When i compute sum of a node which is not mathematically altered,
i get the sum despite having a NaN as one of the nodes.
but, this gives me an error.
Could you please be kind enough to explain this?


Hi,

I'm not sure I understand your problem fully, however, I'm wondering whether
you realize that over here
...
 <state_local_match_total>
   <xsl:value-of select="format-number(
        sum(rehab/state_local_match[
          number(.)=number(.)]),'###,###.##','MyFormat')"/>
 </state_local_match_total>

the XPath predicate is particularly intriguing, as the specified condition
'number(.)=number(.)' will always be true (all nodes for which it is true
that their content, when converted to a number, equals their own content
converted to a number)

Might you be looking for 'number(.)=number(current())'?

If not, then IMHO it means nothing, and could as well be left out.


Greetz,

Andreas



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