The sum() function calculates the total of a sequence of numeric values or durations.
For example, if the context node is the element <rect x="20" y="30"/> , then the expression «sum(@*) » returns 50 .
Argument | Data Type | Meaning |
---|---|---|
sequence | xdt:anyAtomicType* | The set of items to be totaled |
zero-value (optional) | xdt:anyAtomicType | The value to be returned when the sequence is empty |
Result | xdt:anyAtomicType | The total of the values in the sequence |