<?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>6934</bug_id>
          
          <creation_ts>2009-05-20 16:39:12 +0000</creation_ts>
          <short_desc>Comments occur before the version declaration in test cases</short_desc>
          <delta_ts>2009-10-14 16:09:13 +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>1.0.2</version>
          <rep_platform>All</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="Josh Spiegel">josh.spiegel</reporter>
          <assigned_to name="Frans Englich">frans.englich</assigned_to>
          <cc>josh.spiegel</cc>
    
    <cc>mike</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>25229</commentid>
    <comment_count>0</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2009-05-20 16:39:12 +0000</bug_when>
    <thetext>In many test cases (e.g. K-VersionProlog-1) comments occur before the version declaration.  This seems to be contrary to the XQuery specification:

&quot;If a version declaration is present, no Comment may occur before the end of the version declaration. If such a Comment is present, the result is implementation-dependent.&quot;

see http://www.w3.org/TR/xquery/#id-version-declaration, section 4.1, 4th paragraph.  

In our implementation, we will raise an error in such cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25247</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-05-21 06:54:57 +0000</bug_when>
    <thetext>Any chance you could enumerate the test cases concerned?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25252</commentid>
    <comment_count>2</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2009-05-21 17:11:05 +0000</bug_when>
    <thetext>Here are tests I found in ./XQTS/Queries/XQuery/ which have comments before a version declaration:

 Expressions/PrologExpr/VersionProlog/K-VersionProlog-1.xq
 Expressions/PrologExpr/VersionProlog/K-VersionProlog-2.xq
 Expressions/PrologExpr/VersionProlog/K-VersionProlog-3.xq
 Expressions/PrologExpr/VersionProlog/K-VersionProlog-4.xq
 Expressions/PrologExpr/VersionProlog/K-VersionProlog-5.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-001.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-002.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-003.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-004.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-006.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-007.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-008.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-009.xq
 Expressions/PrologExpr/VersionProlog/version_declaration-010.xq
 SchemaImport/versionPrologSI/version_declaration-005.xq

Here are tests I found in ./XQTS/Queries/XQuery/ which have a version declaration without preceding comments:

 Expressions/PrologExpr/VersionProlog/prolog-version-1.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-10.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-11.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-12.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-3.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-4.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-5.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-6.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-7.xq
 Expressions/PrologExpr/VersionProlog/prolog-version-9.xq
 SchemaImport/versionPrologSI/prolog-version-8.xq</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25254</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-05-21 17:36:29 +0000</bug_when>
    <thetext>I think the author of the test in many/most of these cases probably didn&apos;t intend the comment to appear before the version declaration. However, the expected test results in most cases do seem to allow an error to be reported, so it&apos;s not clear to me that the expected results are incorrect for these tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25257</commentid>
    <comment_count>4</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2009-05-21 18:58:34 +0000</bug_when>
    <thetext>First of all, thank you Dr. Kay for your quick attention to this issue.  

It is my understanding that of the 15 tests I listed, only version_declaration-001,002,003,004 will pass with any error.  The remaining 11 tests either expect a specific error or no error at all.  In other words, our implementation that throws an error when comments occur before the declaration will fail the 11 tests when it should not.  Forgive me if this is incorrect.  



</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28343</commentid>
    <comment_count>5</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2009-10-14 14:17:42 +0000</bug_when>
    <thetext>Those 15 tests should now be fixed to have the version declaration in the beginning. Might be I missed something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28351</commentid>
    <comment_count>6</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2009-10-14 16:09:13 +0000</bug_when>
    <thetext>Verified.  Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>