home contribute faq download

FunctX XSLT Functions

functx:min-node

The XML node whose typed value is the minimum

Google
Webxsltfunctions.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()*

XSLT Function Declaration

See XQuery definition.
<xsl:function name="functx:min-node" as="node()*"
              xmlns:functx="http://www.functx.com">
  <xsl:param name="nodes" as="node()*"/>

  <xsl:sequence select="
   $nodes[. = min($nodes)]
 "/>

</xsl:function>

Examples

<xsl:variable name="in-xml" as="item()*">
<values>
      <int>1</int>
      <int>23</int>
      <int>115</int>
</values>
</xsl:variable>
XPath 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, http://www.datypic.com
Datypic XSLT Services

Recommended Reading:

XQuery