Description
The functx:min-string function returns the minimum of the values in $strings . It differs from
the built-in fn:min function only in treats values of all types like strings. The fn:min function, by contrast, treats untyped and numeric values like numbers (and an error is raised if they are not numbers).
Arguments and Return TypeName | Type | Description |
$strings |
xs:anyAtomicType* |
the sequence of strings |
return value |
xs:string? |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:min-string" as="xs:string?"
xmlns:functx="http://www.functx.com">
<xsl:param name="strings" as="xs:anyAtomicType*"/>
<xsl:sequence select="
min(for $string in $strings return string($string))
"/>
</xsl:function>
|
Examples<xsl:variable name="in-xml" as="item()*"> | | <in-xml>
<x>a</x>
<y>c</y>
<z>b</z>
</in-xml> |
| </xsl:variable> |
XPath Example | Results | Explanation |
---|
functx:min-string( $in-xml/* ) |
a |
Calling the fn:min function instead would have raised an error. |
functx:min-string( (100,25,3) ) |
100 |
See AlsoHistory |
Recommended Reading:
|