Subject: RE: [xsl] Multiply From: Linda van den Brink <lvdbrink@xxxxxxx> Date: Wed, 7 Feb 2001 14:23:01 +0100 |
> -----Original Message----- > From: Jo Kong HO [mailto:JoK@xxxxxxxxxxxxxx] > Sent: Wednesday, February 07, 2001 12:53 PM > To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' > Subject: [xsl] Multiply > > > Hi > > A beginners question. If I have the following XML : > > <numbers> > <one>1</one> > <two>2</two> > <three>3</three> > </numbers> > > And I want to generate the mutilple of these numbers, How > would I do it in > XSLT? To get the total of those numbers (which I assume is what you want) you can use the sum() function: <xsl:template match="numbers"> Total = <xsl:value-of select="sum(*)"/> </xsl:template> The argument to the sum function is a node-set, so in this case it adds up the value of all the children of the numbers element. Linda XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Multiply, Jo Kong HO | Thread | re: [xsl] newbie: problems computin, Sam Griffiths |
Re: [xsl] newbie: problems computin, David Carlisle | Date | RE: [xsl] newbie: problems computin, Sam Griffiths |
Month |