[XPath 2.0] Return value always has declared return type?

In Section 3.1.5, it says:

"3. The function is evaluated using the converted argument values. The
result is a value of the function's declared return type."

As I understand it, the return value of a function is not always the
declared return type.  distinct-values( (1,2,3) ) would not return 3 values
of type xdt:anyAtomicType.  

The XQuery draft contains a paragraph of clarification that includes "the
value returned by a function retains its most specific type, which may be a
subtype of the declared return type of the function.".  I think this
paragraph should be included in XPath as well.  

Also, the paragraph in the XQuery draft implies that it is only for
user-defined functions. I think it should apply to both built-in and
user-defined functions in XQuery, right?

 
Thanks,
Priscilla Walmsley

Received on Wednesday, 4 February 2004 07:43:19 UTC