Description
The functx:are-distinct-values function returns true if all of the values in the sequence are distinct; i.e., no one value appears more than once in the sequence. Distinctness is based on type equality.
Arguments and Return Type| Name | Type | Description |
$seq |
xs:anyAtomicType* |
the sequence of values |
| return value |
xs:boolean |
XQuery Function Declaration| See XSLT definition. | | XQuery Syntax for January 2007 (1.0): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:are-distinct-values
( $seq as xs:anyAtomicType* ) as xs:boolean {
count(distinct-values($seq)) = count($seq)
} ; | | XQuery Syntax for July 2004 - November 2005 (CR): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:are-distinct-values
( $seq as xdt:anyAtomicType* ) as xs:boolean {
count(distinct-values($seq)) = count($seq)
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function are-distinct-values
( $seq as xdt:anyAtomicType* ) as xs:boolean {
fn:count(fn:distinct-values($seq)) = fn:count($seq)
} |
Examples| XQuery Example | Results |
|---|
functx:are-distinct-values( (1,2,1,3))
|
false
|
functx:are-distinct-values( (1,2,1,3,2.0))
|
false
|
functx:are-distinct-values( (1,2,3) )
|
true
|
See AlsoHistory |
|