<?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>23923</bug_id>
          
          <creation_ts>2013-11-26 11:22:23 +0000</creation_ts>
          <short_desc>[QT3TS] XQueryX conversion errors</short_desc>
          <delta_ts>2014-03-18 15:31:43 +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 &amp; XPath 3 Test Suite</component>
          <version>2nd Edition Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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="Tim Mills">tim</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>jmdyck</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>96823</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-11-26 11:22:23 +0000</bug_when>
    <thetext>A number of tests are affected by the following conversion errors.


1. Incorrect conversion of \uXXXX.  e.g. re00741 where the string literal

&apos;[^a-f-[\x00-\x60\u007B-\uFFFF]]+&apos;

becomes

&lt;xqx:stringConstantExpr&gt;
&lt;xqx:value&gt;[^a-f-[\x00-\x60{-&amp;#65535;]]+&lt;/xqx:value&gt;
&lt;/xqx:stringConstantExpr&gt;


2.  More XML 1.1 problems.  e.g. line-ending-Q006, where
               &lt;xqx:stringConstantExpr&gt;
                 &lt;xqx:value&gt; &amp;#8232; &lt;/xqx:value&gt;
               &lt;/xqx:stringConstantExpr&gt;

isn&apos;t the same as &apos; &amp;#x2028; &apos;.

3. Incorrect conversion of element(name, type?) (e.g. fn-nilled-40) 
missing &lt;xqx:nillable /&gt;

4. Incorrect conversion of eqname-009.

Q{ http://www.example.com/ ns }b

is converted to

    &lt;xqx:nameTest xqx:URI=&quot; http://www.example.com/ ns &quot;&gt;b&lt;/xqx:nameTest&gt;

but should probably be

    &lt;xqx:nameTest xqx:URI=&quot;http://www.example.com/ ns&quot;&gt;b&lt;/xqx:nameTest&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97004</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2013-12-03 01:21:04 +0000</bug_when>
    <thetext>(In reply to Tim Mills from comment #0)
&gt; 
&gt; 1. Incorrect conversion of \uXXXX.  e.g. re00741 where the string literal
&gt; 
&gt; &apos;[^a-f-[\x00-\x60\u007B-\uFFFF]]+&apos;
&gt; 
&gt; becomes
&gt; 
&gt; &lt;xqx:stringConstantExpr&gt;
&gt; &lt;xqx:value&gt;[^a-f-[\x00-\x60{-&amp;#65535;]]+&lt;/xqx:value&gt;
&gt; &lt;/xqx:stringConstantExpr&gt;

I think this is the same problem as in Bug 13796.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97008</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2013-12-03 02:29:04 +0000</bug_when>
    <thetext>(In reply to Tim Mills from comment #0)

&gt; 2.  More XML 1.1 problems.  e.g. line-ending-Q006, where
&gt;                &lt;xqx:stringConstantExpr&gt;
&gt;                  &lt;xqx:value&gt; &amp;#8232; &lt;/xqx:value&gt;
&gt;                &lt;/xqx:stringConstantExpr&gt;
&gt; 
&gt; isn&apos;t the same as &apos; &amp;#x2028; &apos;.

Looks the same to me. What&apos;s the problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97012</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2013-12-03 02:54:45 +0000</bug_when>
    <thetext>&gt; 
&gt; 3. Incorrect conversion of element(name, type?) (e.g. fn-nilled-40) 
&gt; missing &lt;xqx:nillable /&gt;

That definitely looks like a bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97013</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2013-12-03 03:08:43 +0000</bug_when>
    <thetext>&gt; 4. Incorrect conversion of eqname-009.
&gt; 
&gt; Q{ http://www.example.com/ ns }b
&gt; 
&gt; is converted to
&gt; 
&gt;     &lt;xqx:nameTest xqx:URI=&quot; http://www.example.com/ ns &quot;&gt;b&lt;/xqx:nameTest&gt;

I&apos;m pretty sure that&apos;s a valid conversion, because it back-converts to exactly the original URIQualifiedName.


&gt; but should probably be
&gt; 
&gt;     &lt;xqx:nameTest xqx:URI=&quot;http://www.example.com/ ns&quot;&gt;b&lt;/xqx:nameTest&gt;

I believe that too would be a valid conversion, because it back-converts to a URIQualifiedName that, although lexically different from the original, is semantically the same.

Does the Working Group have a preference?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97015</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-12-03 05:23:58 +0000</bug_when>
    <thetext>(In reply to Michael Dyck from comment #2)
&gt; (In reply to Tim Mills from comment #0)
&gt; 
&gt; &gt; 2.  More XML 1.1 problems.  e.g. line-ending-Q006, where
&gt; &gt;                &lt;xqx:stringConstantExpr&gt;
&gt; &gt;                  &lt;xqx:value&gt; &amp;#8232; &lt;/xqx:value&gt;
&gt; &gt;                &lt;/xqx:stringConstantExpr&gt;
&gt; &gt; 
&gt; &gt; isn&apos;t the same as &apos; &amp;#x2028; &apos;.
&gt; 
&gt; Looks the same to me. What&apos;s the problem?

&amp;#x2028; is LINE SEPARATOR.

This test is for a processor which follows the XML 1.1 line ending rules.  Such a processor will perform line ending normalization on &amp;#x2028;.

When converted to XQueryX/XML 1.0 the &amp;x2028; is not treated by the XML parser as a line ending character.  It would be if it were XQuery/XML 1.1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97016</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-12-03 05:30:22 +0000</bug_when>
    <thetext>(In reply to Michael Dyck from comment #4)
&gt; &gt; 4. Incorrect conversion of eqname-009.
&gt; &gt; 
&gt; &gt; Q{ http://www.example.com/ ns }b
&gt; &gt; 
&gt; &gt; is converted to
&gt; &gt; 
&gt; &gt;     &lt;xqx:nameTest xqx:URI=&quot; http://www.example.com/ ns &quot;&gt;b&lt;/xqx:nameTest&gt;
&gt; 
&gt; I&apos;m pretty sure that&apos;s a valid conversion, because it back-converts to
&gt; exactly the original URIQualifiedName.
&gt; 
&gt; 
&gt; &gt; but should probably be
&gt; &gt; 
&gt; &gt;     &lt;xqx:nameTest xqx:URI=&quot;http://www.example.com/ ns&quot;&gt;b&lt;/xqx:nameTest&gt;
&gt; 
&gt; I believe that too would be a valid conversion, because it back-converts to
&gt; a URIQualifiedName that, although lexically different from the original, is
&gt; semantically the same.
&gt; 
&gt; Does the Working Group have a preference?

True.  As an aside, I note that xqx:URI is an xs:string, and wonder why it&apos;s not an anyURI.   

 I&apos;ll change our XQueryX processor to perform the normalization.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97020</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2013-12-03 09:07:40 +0000</bug_when>
    <thetext>(In reply to Tim Mills from comment #5)
&gt; (In reply to Michael Dyck from comment #2)
&gt; &gt; (In reply to Tim Mills from comment #0)
&gt; &gt; 
&gt; &gt; &gt; 2.  More XML 1.1 problems.  e.g. line-ending-Q006, where
&gt; &gt; &gt;                &lt;xqx:stringConstantExpr&gt;
&gt; &gt; &gt;                  &lt;xqx:value&gt; &amp;#8232; &lt;/xqx:value&gt;
&gt; &gt; &gt;                &lt;/xqx:stringConstantExpr&gt;
&gt; &gt; &gt; 
&gt; &gt; &gt; isn&apos;t the same as &apos; &amp;#x2028; &apos;.
&gt; &gt; 
&gt; &gt; Looks the same to me. What&apos;s the problem?
&gt; 
&gt; &amp;#x2028; is LINE SEPARATOR.
&gt; 
&gt; This test is for a processor which follows the XML 1.1 line ending rules. 
&gt; Such a processor will perform line ending normalization on &amp;#x2028;.
&gt;
&gt; When converted to XQueryX/XML 1.0 the &amp;x2028; is not treated by the XML
&gt; parser as a line ending character.  It would be if it were XQuery/XML 1.1.

Ah, right, the conversion-to-XQueryX code only ever generates files with
    &lt;?xml version=&quot;1.0&quot;?&gt;
I suppose it could generate version=&quot;1.1&quot; for test-cases that have
    &lt;dependency type=&quot;xml-version&quot; value=&quot;1.1&quot;/&gt;
but is that enough? Could there be an XQueryX processor that only accepts 1.1 files, and so would (also) want a &quot;1.1&quot; version of the vast majority of test-cases that don&apos;t have an xml-version dependency?

Or is an XQueryX processor obliged to handle input in *all* versions of XML? The XQueryX spec doesn&apos;t seem to say explicitly, but it says:
    An XQueryX processor that claims to conform to this
    specification MUST implement the XQueryX syntax as defined in
    4 &apos;An XML Schema for the XQuery XML Syntax&apos; of this specification ...
and an XML document conforms to that syntax regardless of its version decl, right? So if &quot;implementing the syntax&quot; means &quot;recognizing all instances of the syntax&quot;, that suggests that a conforming XQueryX processor must accept input in all versions of XML.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97072</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2013-12-03 18:57:00 +0000</bug_when>
    <thetext>(In reply to Tim Mills from comment #5)
&gt; 
&gt; When converted to XQueryX/XML 1.0 the &amp;x2028; is not treated by the XML
&gt; parser as a line ending character.  It would be if it were XQuery/XML 1.1.

On second thought, I&apos;m not so sure. Semantically, an XQueryX processor evaluates a query by:
(a) transforming it to the human-readable syntax; and
(b) evaluating the human-readable syntax.
And it&apos;s not clear that the version of XML used in (a) must match the choice of choice of rules for normalizing line breaks in (b).

Specifically, although the query begins with
    &lt;?xml version=&quot;1.0&quot;?&gt;
and so must be processed by an XML 1.0 processor, which will leave the Line Separator as is, that happens at (a), and it&apos;s still possible for the XQuery processor at (b) to use the end-of-line rules of XML 1.1 (as indicated in the test-case), which *will* normalize the Line Separator into a Line Feed.

(Or it can skip the test-case if it&apos;s unable to use the 1.1 rules at (b).)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98102</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2014-01-07 19:59:11 +0000</bug_when>
    <thetext>(In reply to Michael Dyck from comment #3)
&gt; &gt; 
&gt; &gt; 3. Incorrect conversion of element(name, type?) (e.g. fn-nilled-40) 
&gt; &gt; missing &lt;xqx:nillable /&gt;
&gt; 
&gt; That definitely looks like a bug.

I believe I&apos;ve now fixed that bug in the converter.
This adds &lt;xqx:nillable/&gt; to its output for the following tests:
    fn-nilled-40
    fn-nilled-42
    fn-nilled-43
    fn-nilled-49
    fn-nilled-53
    hof-039
    hof-053
    K2-ExternalVariablesWith-22
    K2-ExternalVariablesWith-22a
    K2-ExternalVariablesWith-23</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102568</commentid>
    <comment_count>10</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2014-03-18 15:31:43 +0000</bug_when>
    <thetext>I believe this bug is now fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>