You're saying "for each summary, give me the sum of the amounts in that summary", and that's exactly what you are getting. But you want a single sum, not one for each summary. That's sum(summary/amount), executed with LPSRequest as the context item.
If you're going to post XML/XSLT that is abstracted from the real XML/XSLT, please test it before you post it. When people make transcription errors in their posts, it's hard to tell whether that's the real problem or just a distraction caused by careless posting.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|