[Bug 6688] [XQTS] K2-FilterExpr-8 should allow empty sequence

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6688





--- Comment #3 from Oliver Hallam <oliver@cbcl.co.uk>  2009-03-12 15:42:54 ---
I will concede that () is not a desirable result, but am unconvinced that it is
not a valid result.  And indeed XQTS is intended to test for conformity, not
reasonability.

Whether or not this is allowed by the spec hinges on whether this is considered
a cardinality constraint:

XQuery 2.3.4:
"There is an exception to this rule: If a processor evaluates an operand E
(wholly or in part), then it is required to establish that the actual value of
the operand E does not violate any constraints on its cardinality. For example,
the expression $e eq 0 results in a type error if the value of $e contains two
or more items. A processor is not allowed to decide, after evaluating the first
item in the value of $e and finding it equal to zero, that the only possible
outcomes are the value true or a type error caused by the cardinality
violation. It must establish that the value of $e contains no more than one
item."

As I interpret this rewriting "treat as ()" as "()" is (barely) admissible
since this does not require its argument to be evaluated.

Under static typing any non-trivial expression that can only take the value ()
raises an XPST0005 error, so under static typing this error is certainly a
reasonable (if not the only correct) result.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 12 March 2009 15:43:03 UTC