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]
Other format: [Raw text]

Calculating Averages


Just wondering how i could get an average topic score (per topic) where
score of 0 are excluded.

------
OUTPUT:
------
<topics>
	<topic>
		<id>1</id>
		<mean>5</mean>
	</topic>
	<topic>
		<id>2</id>
		<mean>3.5</mean>
	</topic>
	<topic>
		<id>3</id>
		<mean>5</mean>
	</topic>
	<topic>
		<id>4</id>
		<mean>5</mean>
	</topic>
</topics>
-----
INPUT:
-----
.
.
.
<eval>
	<id>1</id>
	<topics>
		<topic>
			<id>1</id>
			<score>5</score>
		</topic>
		<topic>
			<id>2</id>
			<score>4</score>
		</topic>
		<topic>	
			<id>4</id>
			<score>5</score>
		</topic>
	</topics>
</eval>
<eval>
	<id>5</id>
	<topics>
		<topic>	
			<id>2</id>
			<score>3</score>	
		</topic>
		<topic>	
			<id>3</id>
			<score>5</score>
		</topic>
		<topic>
			<id>4</id>
			<score>0</score>
		</topic>
	</topics>
</eval>
.
.
.

 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]