<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>2942</bug_id>
          
          <creation_ts>2006-02-26 22:55:57 +0000</creation_ts>
          <short_desc>can WhereExpr010.xq clause raise FORG0006?</short_desc>
          <delta_ts>2006-06-17 20:28:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>0.8.6</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marc Van Cappellen">marc.van.cappellen</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</assigned_to>
          <cc>jinghaol</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>8458</commentid>
    <comment_count>0</comment_count>
    <who name="Marc Van Cappellen">marc.van.cappellen</who>
    <bug_when>2006-02-26 22:55:57 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9066</commentid>
    <comment_count>1</comment_count>
    <who name="Jinghao Liu">jinghaol</who>
    <bug_when>2006-04-07 06:12:16 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9426</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2006-04-24 20:54:14 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; I think error XPTY0004 (http://www.w3.org/TR/xquery/#ERRXPTY0004) is more
&gt; appropriate. 1) It has reference in XQuery spec 2) it align with the bug
&gt; 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 &apos;where&apos; 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&apos;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&apos;re down to &quot;in all other cases&quot;, and the result is a type error [err:FORG0006]. Or am I reading this wrong?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9862</commentid>
    <comment_count>3</comment_count>
    <who name="Marc Van Cappellen">marc.van.cappellen</who>
    <bug_when>2006-05-18 21:16:22 +0000</bug_when>
    <thetext>Andrew,

found out this was assigned to me. Don&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9867</commentid>
    <comment_count>4</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-05-19 14:35:52 +0000</bug_when>
    <thetext>Marc:

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

Thanks,
Carmelo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9905</commentid>
    <comment_count>5</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2006-05-30 20:24:55 +0000</bug_when>
    <thetext>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.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10075</commentid>
    <comment_count>6</comment_count>
    <who name="Marc Van Cappellen">marc.van.cappellen</who>
    <bug_when>2006-06-17 20:28:18 +0000</bug_when>
    <thetext>I confirm this is resolved in XQTS 0.9.4</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>