<?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>19257</bug_id>
          
          <creation_ts>2012-10-03 17:16:29 +0000</creation_ts>
          <short_desc>[XQ3.0] Context item must be a singleton</short_desc>
          <delta_ts>2013-06-19 09:31:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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="Michael Kay">mike</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>g</cc>
    
    <cc>tim</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>75242</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-10-03 17:16:29 +0000</bug_when>
    <thetext>In 4.17, Context item declaration, the specification does not make it clear what happens if the initial value of the context item evaluates to (a) an empty sequence, or (b) a sequence containing more than one item. 

The second case is clearly an error, and we need to say so.

The first case is either an error, or results in the context item being &quot;absent&quot; and therefore unusable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75410</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-10-05 21:32:59 +0000</bug_when>
    <thetext>I agree. I would prefer to make both cases errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75511</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-10-07 19:00:54 +0000</bug_when>
    <thetext>It must surely be XPTY0004 since the context item type can only be specified as an item (not sequence) type by virtue of the grammar

[31]   	ContextItemDecl	   ::=   	&quot;declare&quot; &quot;context&quot; &quot;item&quot; (&quot;as&quot; ItemType)? ((&quot;:=&quot; VarValue) | (&quot;external&quot; (&quot;:=&quot; VarDefaultValue)?))

and is effectively

declare context item as item() external;

when not explicitly declared.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75699</commentid>
    <comment_count>3</comment_count>
    <who name="Ghislain Fourny">g</who>
    <bug_when>2012-10-09 15:45:56 +0000</bug_when>
    <thetext>I tend to agree with Tim. I think it can be logically inferred from the current specification that a type error will be raised in both cases. Perhaps a note saying so might make this clearer though?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75700</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-10-09 15:48:31 +0000</bug_when>
    <thetext>The Working Group agrees. I will make the changes in comments 0, 1, and 2.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>