Description
The functx:non-distinct-values function returns any values that appear more than once in a list, based on typed value. All the values must have comparable types, or be untyped.
Arguments and Return Type| Name | Type | Description |
$seq |
xs:anyAtomicType* |
the sequence of values |
| return value |
xs:anyAtomicType* |
XSLT Function Declaration| See XQuery definition. | | XSLT 2.0 Syntax: |
|---|
<xsl:function name="functx:non-distinct-values" as="xs:anyAtomicType*"
xmlns:functx="http://www.functx.com" >
<xsl:param name="seq" as="xs:anyAtomicType*"/>
<xsl:sequence select="
for $val in distinct-values($seq)
return $val[count($seq[. = $val]) > 1]
"/>
</xsl:function>
|
Examples| XSLT Example | Results |
|---|
functx:non-distinct-values( (1,2,1,3))
|
1
|
functx:non-distinct-values( (1,2,1,3,2.0))
|
(1, 2)
|
functx:non-distinct-values( (1,2,3) )
|
()
|
See AlsoHistory |
|