This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 2942 - can WhereExpr010.xq clause raise FORG0006?
Summary: can WhereExpr010.xq clause raise FORG0006?
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.8.6
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-26 22:55 UTC by Marc Van Cappellen
Modified: 2006-06-17 20:28 UTC (History)
1 user (show)

See Also:


Attachments

Description Marc Van Cappellen 2006-02-26 22:55:57 UTC
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
Comment 1 Jinghao Liu 2006-04-07 06:12:16 UTC
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.
Comment 2 Jonathan Robie 2006-04-24 20:54:14 UTC
(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?
Comment 3 Marc Van Cappellen 2006-05-18 21:16:22 UTC
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
Comment 4 Carmelo Montanez 2006-05-19 14:35:52 UTC
Marc:

Not sure how this was assigned to you.  I aam re assigning to Jinghao Liu as it should.

Thanks,
Carmelo
Comment 5 Andrew Eisenberg 2006-05-30 20:24:55 UTC
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.

Comment 6 Marc Van Cappellen 2006-06-17 20:28:18 UTC
I confirm this is resolved in XQTS 0.9.4