[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

sum of products

Subject: sum of products
From: "Steve Renshaw" <renshaw_steve@xxxxxxxxxxx>
Date: Wed, 10 Oct 2001 09:50:09 +0000
sum of products
How do you write the xpath to calculate the sum or a*b for the
following xml limiting <data> items to those with a value of
say id="2". For the following xml:

<items>
<item>
 <data id="1"><a> 1</a><b> 2</b><c> 3</c></data>
 <data id="2"><a> 4</a><b> 5</b><c> 6</c></data>
 <data id="3"><a> 7</a><b> 8</b><c> 9</c></data>
</item>
<item>
 <data id="1"><a> 2</a><b> 3</b><c> 4</c></data>
 <data id="2"><a> 5</a><b> 6</b><c> 7</c></data>
 <data id="3"><a> 8</a><b> 9</b><c>10</c></data>
</item>
<item>
 <data id="1"><a> 3</a><b> 4</b><c> 5</c></data>
 <data id="2"><a> 6</a><b> 7</b><c> 8</c></data>
 <data id="3"><a> 9</a><b>10</b><c>11</c></data>
</item>
</items>

The sum I need calculated is:

        1st   2nd   3rd
        item  item  item
  Sum = 4*5 + 5*6 + 6*7


_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.