Description
The functx:value-except function returns the values in one sequence that do not appear in the second sequence, in an implementation-defined order. It removes duplicates, even among the values that appear only in the first sequence. This function is useful because the built-in except operator only works on nodes, not atomic values.
Arguments and Return TypeName | Type | Description |
$arg1 |
xs:anyAtomicType* |
the first sequence |
$arg2 |
xs:anyAtomicType* |
the second sequence |
return value |
xs:anyAtomicType* |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:value-except" as="xs:anyAtomicType*"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg1" as="xs:anyAtomicType*"/>
<xsl:param name="arg2" as="xs:anyAtomicType*"/>
<xsl:sequence select="
distinct-values($arg1[not(.=$arg2)])
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:value-except((1,2,3),(3,4,5)) |
(1, 2) |
functx:value-except((1,1,2,3),(2,3)) |
1 |
functx:value-except((1,2),(3,4)) |
(1, 2) |
functx:value-except((1,2,2,3),()) |
(1, 2, 3) |
See AlsoHistory |
Recommended Reading:
|