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

RE: Aggregate

Subject: RE: Aggregate
From: Don Bruey <dbruey@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 1 Nov 2000 18:21:13 -0400 (EST)
how to sum time aggregate
Find the sum of all time elements
	sum(//time)

divided by 
	div

the count of all time elements
	count(//time) 

<xsl:value-of select="sum(//time) div count(//time)" />
will work.

Don

>-----Original Message-----
>From: Reddy, Nagesh [mailto:Nagesh_Reddy@xxxxxxx]
>Sent: Wednesday, November 01, 2000 8:55 AM
>To: 'XSL-List@xxxxxxxxxxxxxxxx'
>Subject: Aggregate
>
>
> Hi,
>
>I would like to know if we can aggregete a set of xml data. I want the
>average of time in this file which should be (10+12+8)/3. The 
>answer would
>be 10
>
> For Example
>
> <IN>
>
> <name>A</name>
>
> <time>10</time>
>
> </IN>
>
>
> <IN>
>
> <name>B</name>
>
> <time>12</time>
>
> </IN>
>
>
> <IN>
>
> <name>C</name>
>
> <time>8</time>
>
> </IN>
>
>
>I am using Schemas and XML so where do i do the average in 
>Schemas or XML
>please respond at the earliest.
>
>Thanks
>Nagesh Reddy
>
>
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>




 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.