• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSLT Calculations

 
Siva Arun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Input XML



XSL


I just want to calculate the average marks of all the students and display it on the same output HTML. Could you please guide me?
Thanks in advance.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a "sum(nodeset)" function in XSLT. And I expect if you looked in some documentation you would find another function called something like "count". Those should take care of the problem.
 
Siva Arun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below code works fine.




avg function seems to be not available in XLST 1.0 version. Though I used XSLT 2.0, It is giving me the error.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic