Given a sequence, returns a new sequence containing one copy of each unique value in the original sequence.
$collation as xs:string
A sequence of atomic values.
distinct-values() also has an
optional argument specifying a collation algorithm. If present,
the collation algorithm is used to determine whether two values
are different from each other.
A sequence containing only one copy of each atomic value in the original sequence. Some minor complications are as follows:
distinct-values() returns its
result sequence, the order in which the unique values are
returned is implementation-defined. Also, within a group of
values that have the same value, which
value is returned is implementation-defined.
If the input sequence is the empty sequence, the empty
sequence is returned. Passing the empty sequence to
distinct-values() does not raise
xs:double values, positive zero and
negative zero are considered equal. Also, if there are numbers
with the value
NaN (not a
number), only one of those values will be in the result
xs:time values, if those values
don’t have a timezone component, their timezone is considered
to be the timezone returned by the
Also be aware that
xs:time values can be equal even ...