xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] calculation all values but not the last one


Subject: Re: [xsl] calculation all values but not the last one
From: Alexander Anokhin <ava@xxxxxx>
Date: Tue, 02 Nov 2004 15:35:39 +0400

Christoph Klocker:
Hi,
I am trying to sum up all index-values where year='2002' but not the last
one.
How can I do this?

<Result>
<Monthly>
<MonthUltimo month="8" year="2001" date="2001" index="900" quote="1002" />
<MonthUltimo month="9" year="2001" date="2001" index="988" quote="1287" />
<MonthUltimo month="10" year="2001" date="2001" index="1355" quote="1355" />
<MonthUltimo month="11" year="2001" date="2001" index="1154" quote="1157"/>
<MonthUltimo month="12" year="2001" date="2001" index="1104" quote="1101" />
<MonthUltimo month="1" year="2002" date="2002" index="1114" quote="1112"/>
<MonthUltimo month="2" year="2002" date="2002" index="1082" quote="1082"/>
<MonthUltimo month="3" year="2002" date="2002" index="1023" quote="1023"/>
<MonthUltimo month="4" year="2002" date="2002" index="1017" quote="1017"/>
</Monthly>
</Result>

Thanks for help!
/Christoph


<xsl:value-of select="sum(/Result/Monthly/MonthUltimo[@year='2002'][position() != last()]/@index)"/>

--
Alexander Anokhin,
AVTOVAZ JSC
tel. +7(8482)73-83-48
mailto:ava@xxxxxx
icq:123275798


Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor