SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
| Introduction
| EXSLT Extensions
| Extension attributes (XSLT only)
| Additional serialization parameters
» | Extension functions
| Extension instructions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# saxon:lowest()

lowest($nodes-1 as node()*) ==> node()*

lowest($nodes-1 as node()*, $stored-expression as jt:net.sf.saxon.functions.Evaluate-PreparedExpression) ==> node()?

This function returns (as a sequence of nodes) the node from $nodes-1 that has the lowest value of the supplied stored expression, evaluated as a number.

If the stored expression is omitted, the function is equivalent to the EXSLT set:lowest() function. It returns the node (or nodes, if there are several) whose numeric value (obtained using number(.)) is lower than any other node in the input sequence.

A stored expression may be obtained as the result of calling the saxon:expression function. The stored expression is evaluated for each node in nodes-1 in turn, with that node as the context node, with the context position equal to the position of that node in $nodes-1, and with the context size equal to the size of $nodes-1. Any NaN values are ignored. If the nodes is empty, the result is an empty sequence. If several nodes have the lowest value, the result node is the one that is first in the order of the input sequence. This differs from the EXSLT lowest() function, which returns all the nodes that have the minimum value.

Example: `saxon:lowest(sale, saxon:expression('@price * @qty'))` will evaluate price times quantity for each child <sale> element, and return the node for which this has the lowest value.

Next