This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: sum and substring xpath needed
- From: Joerg Heinicke <joerg dot heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 19 Aug 2002 19:12:10 +0200
- Subject: Re: [xsl] sum and substring xpath needed
- References: <63C4AD0365821F4291ACF76C0672FA3506EF1F@piper6.piper-group.int>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Andrew,
there are already some examples in the archive. It's not possible in the way
you want to do it. I know only 2 possibilities: RTF or Dimitre's FXSL.
Joerg
Andrew Welch wrote:
Hi all,
Please can someone give me the xpath that will sum() the following
values into the select attribute of a variable (ie not a rtf).
<colspec colwidth="38mm"/>
<colspec colwidth="22mm"/>
<colspec colwidth="26mm"/>
<colspec colwidth="43mm"/>
so something like:
<xsl:variable name="total"
select="sum(substring-before(//tgroup/colspec/@colwidth,'mm'))"/>
..this obviously fails because sum() requires a node-set and the
substring functions return strings, but you get the idea. I dont think
its possible to do in a single select but you never know, hopefully
there's some trick available.
cheers
andrew
--
System Development
VIRBUS AG
Fon +49(0)341-979-7419
Fax +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list