Subject: RE: [xsl] sum of the evaluated values From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Thu, 22 Nov 2001 10:46:32 -0000 |
> i have xml: > <event type="1" time="3:00"> > <event type="0" time="2:00"> > <event type="1" time="4:00"> > <event type="1" time="5:00"> > and i need sum of the minutes: number(substring-before(@time,':')) > only where @type=1. > > How it can be done? > The only way to sum over a computed value in pure XSLT 1.0 is to write a recursive named template. Alternatives if you're prepared to use extensions: (a) construct a result tree fragment holding the actual values you want to sum, and then use the sum() function on the nodes in this RTF (this will need the xx:node-set() extension (b) use an extension function such as saxon:sum(event/time, saxon:expression(substring-before(.,':')) Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] sum of the evaluated valu, Jeni Tennison | Thread | [xsl] Re: sum of the evaluated valu, Dimitre Novatchev |
[xsl] Re: sum of the evaluated valu, Dimitre Novatchev | Date | [xsl] XSL stylesheet for XHTML, Henry S. Thompson |
Month |