<?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>29370</bug_id>
          
          <creation_ts>2016-01-12 18:16:38 +0000</creation_ts>
          <short_desc>Optional Operand for Validate Expression</short_desc>
          <delta_ts>2016-01-22 09:28:11 +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.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</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="Josh Spiegel">josh.spiegel</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>andrew_coleman</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>124573</commentid>
    <comment_count>0</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2016-01-12 18:16:38 +0000</bug_when>
    <thetext>The grammar for ValidateExpr was recently changed so that the operand expression is optional:
https://www.w3.org/XML/Group/qtspecs/specifications/xquery-31/html/xquery-31.html#id-validate 

&gt; [102]   	ValidateExpr	   ::=   	&quot;validate&quot; (ValidationMode | (&quot;type&quot; TypeName))? EnclosedExpr
&gt; [103]   	ValidationMode	   ::=   	&quot;lax&quot; | &quot;strict&quot;
&gt; [36]   	EnclosedExpr	   ::=   	&quot;{&quot; Expr? &quot;}&quot;

Here is a relevant bug: 
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29185 

Here is a relevant decision from meeting #621 on 10/27/2015:

&gt; DECISION: WG has agreed to refactor the grammar using the EnclosedExpr in the node constructors, but in the case of the element constructor we shall not use it in the first argument because it cannot be an empty sequence.  Consider the expressions Try, Catch, Validate, ExtensionExpr, Ordered and Unordered, CompDocConstructor, CompAttrConstructor, CompTextConstructor, CompCommentConstructor CompPIConstructor and Namespace

Currently XQuery 3.1 says the following: 

&gt; If the operand of a validate expression does not evaluate to exactly one document or element node, a type error is raised [err:XQTY0030]. 

The specification needs to clarify what it means if the operand is absent.

Once the specification is updated, it is likely one of the following groups of tests will also need to be updated:

   K-CombinedErrorCodes-13a 
   K-CombinedErrorCodes-14a 
   K-CombinedErrorCodes-15a 

This group expects the validate expression to return empty when absent.  The next group expects XQTY0030 when the input is empty:

   K-CombinedErrorCodes-10 
   XQTY0030 
   qischema90171-err</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124668</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2016-01-22 09:28:11 +0000</bug_when>
    <thetext>At the teleconference on 2016-01-12, the WG decided to resolve this by changing the grammar to make &apos;validate { }&apos; a syntax error, and fixup the tests accordingly.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>