# saxon:evaluate()

evaluate(string)

This function allows XPath expressions to be constructed dynamically at runtime.

The supplied string must contain an XPath expression. The result of the function is the result of evaluating the XPath expression. This is useful where an expression needs to be constructed at run-time or passed to the stylesheet as a parameter, for example where the sort key is determined dynamically.

The function `saxon:evaluate(string)` is shorthand for `saxon:eval(saxon:expression(string))`. For the rules governing what may and may not appear in the expression, see saxon:expression. The expression may contain references to variables `$p1`, `$p2`, etc., and the values of these variables may be supplied in the second, third, and subsequent arguments to the `saxon:evaluate()` call.

Expand | Up Next