home contribute faq download

FunctX XSLT Functions

functx:between-exclusive

Whether a value is between two provided values

Google
Webdatypic.com

Description

The functx:between-exclusive function returns true if the $value is between $minValue and $maxValue, exclusive. If the values are of incomparable types, an error will be raised. If $value is the empty sequence, the function returns false.

Arguments and Return Type

NameTypeDescription
$value xs:anyAtomicType? the value to be tested
$minValue xs:anyAtomicType the minimum value
$maxValue xs:anyAtomicType the maximum value
return value xs:boolean

XSLT Function Declaration

See XQuery definition.
<xsl:function name="functx:between-exclusive" as="xs:boolean"
              xmlns:functx="http://www.functx.com">
  <xsl:param name="value" as="xs:anyAtomicType?"/>
  <xsl:param name="minValue" as="xs:anyAtomicType"/>
  <xsl:param name="maxValue" as="xs:anyAtomicType"/>

  <xsl:sequence select="
   $value > $minValue and $value &lt; $maxValue
 "/>

</xsl:function>

Examples

XPath ExampleResultsExplanation
functx:between-exclusive(55, 1, 1000)
true
functx:between-exclusive(1, 1, 1000)
false
functx:between-exclusive(1200, 1, 1000)
false
functx:between-exclusive('b', 'a', 'c')
true
functx:between-exclusive(xs:date('2004-10-31'),
                      xs:date('2004-10-15'),
                      xs:date('2004-11-01'))
true
functx:between-exclusive('a', 1, 1000)
Error Strings cannot be compared to integers.

See Also

functx:between-inclusiveWhether a value is between two provided values, or equal to one of them

History

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

Recommended Reading:

XQuery