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: Sum function


Purnima,
Ok then do something like
<xsl:stylesheet 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xt="http://www.jclark.com/xt"
>
<xsl:template match="/storsys">
 <xsl:variable name="tots">
  <xsl:apply-templates select="storval" mode="mul"/>
 </xsl:variable>
 <xsl:value-of select="sum(xt:node-set($tots)/storval/@tot)"/>      
</xsl:template>

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

</xsl:stylesheet>

Roll on 1.1

Ciao Chris

XML/XSL Portal 
http://www.bayes.co.uk/xml


>-----Original Message-----
>From: owner-xsl-list@lists.mulberrytech.com
>[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Purnima
>Shankaran
>Sent: 08 March 2001 22:40
>To: xsl-list@lists.mulberrytech.com
>Cc: Chris@Bayes.co.uk
>Subject: Re: [xsl] 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
>available'.
>
>Thanks,
>purnima
>
>----- Original Message -----
>From: "Chris Bayes" <Chris@Bayes.co.uk>
>To: <xsl-list@lists.mulberrytech.com>
>Sent: Thursday, March 08, 2001 1:34 PM
>Subject: RE: [xsl] 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


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