RE: MS-FO-LC1-100: Promotion of untyped values in fn:distinct-val ues?

> fn:distinct-values does not say how values of type 
> xdt:untypedAtomic are handled.  I suggest we use the same 
> rule that we use for aggregate functions, namely  "Values of 
> type xdt:untypedAtomic are cast to the type of the other 
> items in $arg. If all values in $arg are of type 
> xdt:untypedAtomic they are converted to xs:string."

But we have other threads that point out that this is a really bad rule,
because it prevents a pipelined implementation. It must be possible to
process untypedAtomic values without looking ahead to discover the types of
all other items in the sequence. This means that each aggregate function
must have a "default type", and untypedAtomic values should be converted to
the default type. For fn:distinct-values, the only sensible default type is
string.

Michael Kay

Received on Monday, 11 August 2003 06:12:57 UTC