XSL: counting values from elements with the same name

maikon

New Member
I am new to the XSL and would appreciate any help with processing a file structured like this:\[code\]<UniML><student> <name>Salvatore</name> <m value="http://stackoverflow.com/questions/15732065/1"> <i value="http://stackoverflow.com/questions/15732065/17.5">Balliol College</i> <i value="http://stackoverflow.com/questions/15732065/3">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/2.88">Balliol College</i> <i value="http://stackoverflow.com/questions/15732065/32.9">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/15.75">Balliol College</i> </m> <m value="http://stackoverflow.com/questions/15732065/5"> <i value="http://stackoverflow.com/questions/15732065/26.25">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/8.75">Balliol College</i> </m></student><student> <name>Karl</name> <m value="http://stackoverflow.com/questions/15732065/1"> <i value="http://stackoverflow.com/questions/15732065/10.5">Balliol College</i> <i value="http://stackoverflow.com/questions/15732065/4.7">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/2.25">Balliol College</i> <i value="http://stackoverflow.com/questions/15732065/12.6">Kellogg College</i> </m> <m value="http://stackoverflow.com/questions/15732065/5"> <i value="http://stackoverflow.com/questions/15732065/3.75">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/1.25">Balliol College</i> </m></student><student> <name>Serenella</name> <m value="http://stackoverflow.com/questions/15732065/1"> <i value="http://stackoverflow.com/questions/15732065/4">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/3.84">Balliol College</i> <i value="http://stackoverflow.com/questions/15732065/14.100000000000001">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/6.75">Balliol College</i> </m> <m value="http://stackoverflow.com/questions/15732065/5"> <i value="http://stackoverflow.com/questions/15732065/20.25">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/42.75">Balliol College</i> <i value="http://stackoverflow.com/questions/15732065/11.25">Kellogg College</i> <i value="http://stackoverflow.com/questions/15732065/3.75">Balliol College</i> </m></student>\[/code\]EDIT: I would like to compute the total score for each student m1*(i1+i2+...)+m5*(i1+i2+...) for each college and output is in XHTML with some structure like this: Salvatore: Balliol score = 1*(17.5+2.88+17.75)+5*(8.8.75), Kellogg score =Karl: Balliol score =, Kellogg score =Any thoughts?
 
Back
Top