W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2004

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

From: Priscilla Walmsley <priscilla@walmsley.com>
Date: Wed, 4 Feb 2004 07:43:00 -0500
To: <public-qt-comments@w3.org>
Message-Id: <20040204124305.C8F84880227@egp.w3.org>

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?

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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:17 UTC