[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Compute sum of a computed node list

Subject: Compute sum of a computed node list
From: vsubramanian@xxxxxxxxxx
Date: Wed, 5 May 2004 12:18:27 -0400
compute sum
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>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.