xsl-list
[Top] [All Lists]

Compute sum of a computed node list

2004-05-05 09:18:27
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?


thanks,
Vidya



<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:decimal-format name="MyFormat" NaN="-" zero-digit="0"/>

<xsl:template match="rehab_services_list">
        <rehab_services_list>
            <xsl:for-each select="rehab">
                <rehab>
...i have the other variables here>...


<xsl:variable name="var_state_local_match" select="$state_local_salary *
($quarterly_sessions div ($non_medicaid_sessions))"/>

                        <state_local_match>
                        <xsl:value-of
select="format-number($var_state_local_match,'###,###.##','MyFormat')"/>
                    </state_local_match>

 </rehab>
            </xsl:for-each>
            <state_local_match_total>
            <xsl:value-of
select="format-number(sum(rehab/state_local_match[number(.)=number(.)]),'###
,###.##','MyFormat')"/>
        </state_local_match_total>
        </rehab_services_list>
        
    </xsl:template>   
</xsl:stylesheet>


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