This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: 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@bmc.com]
>Sent: Wednesday, November 01, 2000 8:55 AM
>To: 'XSL-List@mulberrytech.com'
>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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]