Description
The functx:max-node function returns the node(s) that contains the maximum value, based on typed value. Unlike the built-in fn:max function, it returns the node itself, not its atomic value.
Arguments and Return Type| Name | Type | Description |
$nodes |
node()* |
the sequence of nodes to test |
| return value |
node()* |
XQuery Function Declaration| See XSLT definition. | | XQuery Syntax for July 2004 - January 2007 (1.0): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:max-node
( $nodes as node()* ) as node()* {
$nodes[. = max($nodes)]
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function max-node
( $nodes as node()* ) as node()* {
$nodes[. = fn:max($nodes)]
} |
Exampleslet $in-xml := | <values>
<int>1</int>
<int>23</int>
<int>115</int>
</values> | return |
| XQuery Example | Results |
|---|
functx:max-node($in-xml//int)
|
<int>115</int>
|
See AlsoHistory |
|