home contribute faq download

FunctX XSLT Functions

functx:max-node

The XML node whose typed value is the maximum

Google
Webxsltfunctions.com

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

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

XSLT Function Declaration

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

  <xsl:sequence select="
   $nodes[. = max($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:max-node($in-xml//int)
<int>115</int>

See Also

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

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