home contribute faq download

FunctX XQuery Functions

functx:min-node

The XML node whose typed value is the minimum

Google
Webdatypic.com

Description

The functx:min-node function returns the node(s) that contains the minimum value, based on typed value. Unlike the built-in fn:min function, it returns the node itself, not its atomic value.

Arguments and Return Type

NameTypeDescription
$nodes node()* the sequence of nodes to test
return value node()*

XQuery Function Declaration

See XSLT definition.
declare namespace functx = "http://www.functx.com";
declare function functx:min-node
  ( $nodes as node()* )  as node()* {

   $nodes[. = min($nodes)]
 } ;

Examples

let $in-xml :=
<values>
      <int>1</int>
      <int>23</int>
      <int>115</int>
</values>
return
XQuery ExampleResults
functx:min-node($in-xml//int)
<int>1</int>

See Also

fn:minThe minimum of a sequence of values
functx:max-nodeThe XML node whose typed value is the maximum

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, https://www.datypic.com
Datypic XQuery Services

Recommended Reading:

XQuery