This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Summary Totals by Type


Ron,
Rather than using a function, try just a straight forward:

<TD>$<xsl:value-of select="sum(/flexact/fsatrans/transamount)"/></TD>

At least, it worked for my totals...

Good luck.

-----Original Message-----
From: owner-xsl-list@mulberrytech.com
[mailto:owner-xsl-list@mulberrytech.com]On Behalf Of Ron Grimes
Sent: Friday, July 28, 2000 11:50 AM
To: XSL List (E-mail)
Subject: Summary Totals by Type


Any help I could get with this would be greatly appreciated.

I am trying to create summary totals by type. Given the following,

<flexact xmlns="x-schema:flexact-schema.xml">
  <description>Flexible Spending Account(s)</description>
  <fsatrans>
    <transtype>Claim</transtype>
    <transdate>2000-05-08</transdate>
    <transamount>130.00</transamount>
  </fsatrans>
  <fsatrans>
    <transtype>Reimbursement</transtype>
    <transdate>2000-06-10</transdate>
    <transamount>130.00</transamount>
  </fsatrans>
</flexact>

So, how can I change this function to give me YTD totals for just transtype
= "Claim"?

<xsl:script><![CDATA[
    function ytdClaims(node) {
      total = 0;
      claims = node.selectNodes("/flexact/fsatrans/transamount");
      for (c = claims.nextNode(); c; c = claims.nextNode())
	  total += c.nodeTypedValue;
        return formatNumber(total, "$###,##0.00");
    }
]]></xsl:script>


Thanks,
Ron Grimes


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]