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

RE: Sum function

Subject: RE: Sum function
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Thu, 8 Mar 2001 23:44:27 -0000
xslt sum function multiple node
Ok then do something like
<xsl:template match="/storsys">
 <xsl:variable name="tots">
  <xsl:apply-templates select="storval" mode="mul"/>
 <xsl:value-of select="sum(xt:node-set($tots)/storval/@tot)"/>      

<xsl:template match="storval" mode="mul">
 <storval tot="{noofblocks * blocksize}" />


Roll on 1.1

Ciao Chris

XML/XSL Portal 

>-----Original Message-----
>From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Purnima
>Sent: 08 March 2001 22:40
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Cc: Chris@xxxxxxxxxxx
>Subject: Re:  Sum function
>Hi Chris,
>Thanks for the reply. Your code worked with Saxon. But I am using XT
>processor..it complained that 'implementation of extension namespace not
>----- Original Message -----
>From: "Chris Bayes" <Chris@xxxxxxxxxxx>
>To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>Sent: Thursday, March 08, 2001 1:34 PM
>Subject: RE:  Sum function
>> Shankaran,
>> Depending on your processor you could do someting like this
>> <xsl:stylesheet version='1.0'
>> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
>> xmlns:saxon="http://icl.com/saxon"
>> xmlns:msxsl="urn:schemas-microsoft-com:xslt">
>> <xsl:template match="/storsys">
>> <xsl:variable name="tots">
>> <xsl:apply-templates select="storval" mode="mul" />
>> </xsl:variable>
>> <!--xsl:value-of select="sum(saxon:node-set($tots)/storval/@tot)" /-->
>> <xsl:value-of select="sum(msxsl:node-set($tots)/storval/@tot)" />
>> </xsl:template>
>> <xsl:template match="storval" mode="mul">
>> <storval tot="{noofblocks * blocksize}" />
>> </xsl:template>
>> </xsl:stylesheet>
>> Uncomment <!--xsl:value-of select="sum(saxon:... if you are using saxon
>> Ciao Chris
>> XML/XSL Portal
>> http://www.bayes.co.uk/xml
>>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

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

Current Thread


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.
First Name
Last Name
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.