[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|