News:

And we're back!

Main Menu

Xquery Question.

Started by Grey Fox, April 17, 2011, 08:17:07 PM

Previous topic - Next topic

Grey Fox

Any of you guys know Xquery?

I've got a question.

I have this xml :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet href="class6.xsl" type="text/xsl" ?>
<universite>
<etudiant>
<nom>Rejean Tremblay</nom>
<cours sigle="INF8430" note="89" />
<cours sigle="INF1030" note="69" />
<cours sigle="INF1230" note="75" />
</etudiant>
<etudiant>
<nom>Martin Lambert</nom>
<cours sigle="INF8430" note="75" />
<cours sigle="INF1030" note="72" />
<cours sigle="INF1230" note="73" />
</etudiant>
<etudiant>
<nom>Luc Alain</nom>
<cours sigle="INF9430" note="39" />
<cours sigle="INF1030" note="89" />
<cours sigle="INF1230" note="79" />
</etudiant>
<etudiant>
<nom>Olive Saint-Amant</nom>
<cours sigle="INF8430" note="91" />
<cours sigle="INF1230" note="99" />
</etudiant>
</universite>


I am trying to calculate the avg "note" for each "sigle"

Ex. For INF8430 It'd be the avg of 89+75+91.

I'm stomp. I can count the avg of all notes but I can't find a way to calculate only the avg for each sigle.

Anyone have an idea?
Colonel Caliga is Awesome.

Grey Fox

Colonel Caliga is Awesome.