This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In http://www.w3.org/TR/xquery/#id-where the behaviour for the where clause is defined using the effective boolean value. In http://www.w3.org/TR/xquery/#id-ebv, step 6 we read: In all other cases, fn:boolean raises a type error [err:FORG0006]. As such we believe that FORG0006 should be added as expected error for the test WhereExpr010.xq Thanks, Marc
I think error XPTY0004 (http://www.w3.org/TR/xquery/#ERRXPTY0004) is more appropriate. 1) It has reference in XQuery spec 2) it align with the bug 2559(http://www.w3.org/Bugs/Public/show_bug.cgi?id=2559) resolution.
(In reply to comment #1) > I think error XPTY0004 (http://www.w3.org/TR/xquery/#ERRXPTY0004) is more > appropriate. 1) It has reference in XQuery spec 2) it align with the bug > 2559(http://www.w3.org/Bugs/Public/show_bug.cgi?id=2559) resolution. I am confused by this response. Bug 2559 is not about EBV, which is the central issue in WhereExpr010.xq. Here is the query in question: (: Name: WhereExpr010 :) (: Description: Test 'where' expression returning a sequence with multiple values :) (: insert-start :) declare variable $input-context external; (: insert-end :) for $file in ($input-context//Folder)[1]/File where data( $file/SecurityObject//right ) return $file/FileName The where clause returns a sequence of multiple atomic values. Now let's look at http://www.w3.org/TR/xquery/#id-ebv to see what the EBV is for a sequence of atomic values: 1. If its operand is an empty sequence, fn:boolean returns false. 2. If its operand is a sequence whose first item is a node, fn:boolean returns true. 3. If its operand is a singleton value of type xs:boolean or derived from xs:boolean, fn:boolean returns the value of its operand unchanged. 4. If its operand is a singleton value of type xs:string, xdt:untypedAtomic, or a type derived from one of these, fn:boolean returns false if the operand value has zero length; otherwise it returns true. 5. If its operand is a singleton value of any numeric type or derived from a numeric type, fn:boolean returns false if the operand value is NaN or is numerically equal to zero; otherwise it returns true. 6. In all other cases, fn:boolean raises a type error [err:FORG0006]. A sequence of multiple atomic values does not match cases 1-5, so we're down to "in all other cases", and the result is a type error [err:FORG0006]. Or am I reading this wrong?
Andrew, found out this was assigned to me. Don't know how it comes, but anyway. There seem to be some discussion if the expected result should be FORG0006 or XPTY0004. We still believe FORG0006 is correct. Not sure how to proceed, can you delegate appropriately Thanks, Marc
Marc: Not sure how this was assigned to you. I aam re assigning to Jinghao Liu as it should. Thanks, Carmelo
Marc, Jonathan, I agree that FORG0006 is the correct error and have made this change. Jinghao, if you disagree with this resolution, then please let us know.
I confirm this is resolved in XQTS 0.9.4