<?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>19671</bug_id>
          
          <creation_ts>2012-10-23 16:54:04 +0000</creation_ts>
          <short_desc>[XQ3.0] Backwards compatibility and the version declaration</short_desc>
          <delta_ts>2013-06-19 09:53:51 +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>andrew.eisenberg</cc>
    
    <cc>jim.melton</cc>
    
    <cc>josh.spiegel</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>76967</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-10-23 16:54:04 +0000</bug_when>
    <thetext>We have achieved a very high level of backwards compatibility between XQuery 3.0 and 1.0, as evidenced by the empty content of Appendix J.1.

In fact there is one major backwards incompatibility which is not included in that list: an XQuery 3.0 processor is expected to reject a query that specifies a version declaration of &quot;1.0&quot;.

If there were many incompatibilities, this would make sense. But there are not. If we believe that the list of incompatibilities is correct except for this omission, then it makes no sense to require a 3.0 processor to reject a 1.0 query, and I propose that we change the rule.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77221</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2012-10-28 21:14:59 +0000</bug_when>
    <thetext>I&apos;m not sure that I understand your concern. We say, &quot;If an XQuery 3.0 processor processes a module labeled with a version of &quot;1.0&quot;, it must either raise a static error [err:XQST0031], or attempt to process the module with an XQuery 1.0 processor.&quot;

An XQuery 3.0 processor can also be an XQuery 1.0 processor if it recognizes XQuery 1.0 syntax and provides XQuery 1.0 semantics.

An XQuery 3.0 processor might be given:

xquery version &quot;1.0&quot;; count(./products/product)

and return 12.

It might be given:

xquery version &quot;1.0&quot;;
for $p in ./products/product
group by $cat := $p/category
return &lt;products category=&quot;{$cat}&quot; count=&quot;{count($p)}&quot; /&gt;

and return XPST0003.

This allows an author to use some XQuery 3.0 processors to write XQuery 1.0 modules that will work with other XQuery 1.0 processors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77224</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-10-28 21:50:59 +0000</bug_when>
    <thetext>Under the rules as currently written, an XQuery 3.0 processor either has to incorporate an XQuery 1.0 processor (which means, for example, that it has to understand and enforce all the rules for module circularity that have been swept away in XQuery 3.0), or it has to reject a query labelled as XQuery 1.0. I don&apos;t believe that implementors of XQuery 3.0 processors will relish the prospect of implementing (or retaining an implementation of) restrictions that are no longer relevant in the 3.0 specification, but the alternative of rejecting valid XQuery 1.0 queries is equally unpleasant.

But at the very least we need to add an entry to the currently empty list of incompatibilities, to say that a (pure) XQuery 3.0 processor rejects all queries labelled as XQuery 1.0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77336</commentid>
    <comment_count>3</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2012-10-29 22:06:38 +0000</bug_when>
    <thetext>A slight downside I see is that if the policy is changed to &quot;accept&quot;, it becomes a little awkward if the 3.0 processor encounters a 1.0 labeled module using updates.  Strictly speaking, I would expect it to raise an error as if updates do not exist until XQuery Update 3.0 goes REC. In the current spec, the bit that reads &quot;... or attempt to process the module with an XQuery 1.0 processor. &quot; handles this case cleanly.  

Switching to &quot;accept&quot; seems more tolerable if there very little chance that XQuery Update 3.0 will introduce a backwards incompatibility.  On this same note, can we be sure that XQuery 4.0 won&apos;t introduce a backwards incompatibility with 3.0?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77399</commentid>
    <comment_count>4</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2012-10-30 10:55:43 +0000</bug_when>
    <thetext>At its F2F meeting on 2012-10-30, the WGs agreed to adopt a version-number policy that is outlined by the following bullet points:

XQuery processor that implements version &quot;n.m&quot;

* If given a query specifying version &quot;n.m&quot;, then evaluate it using
&quot;n.m&quot; rules

* If given a query without a version specification, then evaluate
it using &quot;n.m&quot; rules

* If given a query specifying version &quot;x.y&quot;:

- If able to process query strictly as version &quot;x.y&quot;, then may do so

- If unable to process query as version &quot;x.y&quot;, but &quot;willing and able&quot;
to evaluate query as version &quot;n.m&quot;, then
  # may give warning
  # Evaluate using version &quot;n.m&quot; rules

- Otherwise, error


The Editor will wordsmith this policy properly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77409</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-10-30 12:45:04 +0000</bug_when>
    <thetext>&gt; The Editor will wordsmith this policy properly.

Here&apos;s my first attempt.

[Definition: A version declaration can identify the applicable XQuery syntax and semantics for a module, as well as its encoding.] The version number &quot;1.0&quot; indicates a requirement that the module must be processed by an XQuery 1.0 processor; the version number &quot;3.0&quot; indicates a requirement that the module must be processed by an XQuery 3.0 processor. If the version declaration is not present or the version is not included in the declaration, an XQuery 3.0 processor assumes a version of &quot;3.0&quot;.

If an XQuery 3.0 processor processes a module labeled with a version other than &quot;3.0&quot;, it must do one of the following:

* Evaluate the query using the semantics of the XQuery version specified in the version declaration.

* Evaluate the query using the semantics of XQuery 3.0.
  Note: An implementation may issue a warning in this case. 

* Raise a static error [err:XQST0031].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77421</commentid>
    <comment_count>6</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2012-10-30 14:04:09 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt;  The version number 1.0&quot; indicates a requirement 

s/requirement/intent

&gt; * Evaluate the query using the semantics of the XQuery version specified in
&gt; the version declaration.

s/Evaluate the query/process the module
s/semantics/specification
/s/version specified in/identified in/

&gt; * Evaluate the query using the semantics of XQuery 3.0.
&gt;   Note: An implementation may issue a warning in this case. 

s/semantics/specification/

&gt; * Raise a static error [err:XQST0031].</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>