max

Return largest value of the argument's numeric value.


Syntax

max (nodeset[, nodeset])

Description

This function returns the maximum numeric value of the nodes of one or more node sets. If you specify a node set that contains more than one node, all nodes of the set are taken for evaluation.

If necessary, node values are converted to numerical values. If a node value cannot be converted, then NaN is used. This function returns NaN, if at least one argument is NaN.

Compatibility

There is no max function in XPath.

Example

Retrieve the year of birth of the youngest patient (aggregate all /patient/born nodes and determine the maximum numerical value):

max(/patient/born)