DN-FO-09: 15.1.11 fn:distinct-values

DN-FO-09: 15.1.11 fn:distinct-values

There are two issues with this function:

1. This function is of little use because “The order of the values returned
is implementation dependent”.
   The programmer will not be able to find the answer to the following two
questions:

	· Which values and in what order are exactly returned?
	· What should we do if we need to preserve order in the result?


2.    The example is wrong:
            “fn:distinct-values(1, 2.0, 3, 2) returns (1, 3, 2.0)”
      Actually:
            fn:distinct-values(1, 2.0, 3, 2) might return (1, 3, 2.0)

	because the order in which the values are returned is implementation
dependent.

Suggested solution:
	Change the semantics of the function to return each first in sequence order
distinct value.

Dimitre Novatchev.

Received on Monday, 23 June 2003 13:44:25 UTC