EXSLT - dyn:sum

Implementer Page: dyn.sum.html
Function Package: dyn.sum.zip

Function Syntax

number dyn:sum(node-set, string)

The dyn:sum function calculates the sum for the nodes passed as the first argument, where the value of each node is calculated dynamically using an XPath expression passed as a string as the second argument.

The expressions are evaluated relative to the nodes passed as the first argument. In other words, the value for each node is calculated by evaluating the XPath expression with all context information being the same as that for the call to the dyn:sum function itself, except for the following:

  • the context node is the node whose value is being calculated
  • the context position is the position of the node within the node set passed as the first argument to the dyn:sum function, arranged in document order
  • the context size is the number of nodes passed as the first argument to the dyn:sum function

The dyn:sum function returns the sumimum of these values, calculated in exactly the same way as for sum.

If the expression string passed as the second argument is an invalid XPath expression (including an empty string), this function returns NaN.

This function must take a second argument. To calculate the sumimum of a set of nodes based on their string values, you should use the sum function.

Implementations

There are currently no XSLT processors that we know of that support dyn:sum natively.

There are currently no third-party implementations of dyn:sum.

http://www.exslt.org/dyn/functions/sum/index.html last modified 2001-11-25