Remember that sum() and count() are functions that take a sequence (of numbers or nodes) as the argument. So it doesn't make sense to call them within a for-each that is iterating over that sequence - they need to be called once for the whole sequence, not once for each item within the sequence.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|