<?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>21931</bug_id>
          
          <creation_ts>2013-05-05 21:08:28 +0000</creation_ts>
          <short_desc>app/Demos/currencysvg-result.xml should not have an XML declaration.</short_desc>
          <delta_ts>2014-03-19 10:49:01 +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>Working drafts</version>
          <rep_platform>All</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="Leo Wörteler">leo</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>christian.gruen</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>87248</commentid>
    <comment_count>0</comment_count>
    <who name="Leo Wörteler">leo</who>
    <bug_when>2013-05-05 21:08:28 +0000</bug_when>
    <thetext>The documentation of `&lt;assert-xml&gt;` says:

&gt; Asserts the result of the query by providing a serialization of the expression
&gt; result using the default serialization parameters method=&quot;xml&quot; indent=&quot;no&quot;
&gt; omit-xml-declaration=&quot;yes&quot;.

As the file &quot;app/Demos/currencysvg-result.xml&quot; has an XML declaration, I don&apos;t think the test case &quot;currencysvg&quot; can succeed:

&gt;   &lt;test-case name=&quot;currencysvg&quot;&gt;
&gt;      [...]
&gt;      &lt;test file=&quot;Demos/currencysvg.xq&quot;/&gt;
&gt;      &lt;result&gt;
&gt;         &lt;assert-xml file=&quot;Demos/currencysvg-result.xml&quot;/&gt;
&gt;      &lt;/result&gt;   
&gt;   &lt;/test-case&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87249</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-05 21:35:11 +0000</bug_when>
    <thetext>You&apos;re correct that the test isn&apos;t following the authoring guidelines. However, this shouldn&apos;t cause the test to fail. The documentation also states (on the &quot;running tests&quot; page): 

The assert-xml assertion succeeds if the result is an XML document that compares deep-equal to the document contained (in XML form) in the assertion.

And it also says (in the schema documentation): The assertion is true if the result of parsing and canonicalizing the XML given in the body of the assert-xml element is the same (byte-for-byte) as the result of canonicalizing the XML result of the query. 

Clearly the presence of the XML declaration does not affect the comparison if it is done according to these rules.

Assert-xml should not be interpreted as a comparison of serialized results; the schema comments make this clear.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87250</commentid>
    <comment_count>2</comment_count>
    <who name="Leo Wörteler">leo</who>
    <bug_when>2013-05-05 21:46:20 +0000</bug_when>
    <thetext>Correct, I misinterpreted the part saying:

&gt; The value will not necessarily be a well-formed document (it may be a fragment). 
&gt; The comparison can be done by converting the string into a well-formed
&gt; document by adding a wrapper element.

Doing this textually yields invalid XML if an XML declaration is present.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89170</commentid>
    <comment_count>3</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2013-06-12 15:33:50 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Correct, I misinterpreted the part saying:
&gt; 
&gt; &gt; The value will not necessarily be a well-formed document (it may be a fragment). 
&gt; &gt; The comparison can be done by converting the string into a well-formed
&gt; &gt; document by adding a wrapper element.
&gt; 
&gt; Doing this textually yields invalid XML if an XML declaration is present.

No it does not. An XML declaration is optional and if included does not count towards the well-formedness of an XML document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89896</commentid>
    <comment_count>4</comment_count>
    <who name="Christian Gruen">christian.gruen</who>
    <bug_when>2013-06-26 14:01:51 +0000</bug_when>
    <thetext>I agree with Leo that the XML declaration should be removed in this test. First, the resulting XML will indeed be invalid if the string with the XML declaration is converted &quot;into a well-formed document by adding a wrapper element.&quot;, as proposed in the documentation. Second, it seems to be the only test case that does not follow the authoring guidelines, so it’s probably less effort than aligning the documentation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90117</commentid>
    <comment_count>5</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2013-07-02 15:47:23 +0000</bug_when>
    <thetext>I withdraw my comment in #3. If we all agree I will will remove the XML declaration</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90120</commentid>
    <comment_count>6</comment_count>
    <who name="Leo Wörteler">leo</who>
    <bug_when>2013-07-02 16:19:10 +0000</bug_when>
    <thetext>That would be great.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102625</commentid>
    <comment_count>7</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2014-03-19 10:49:01 +0000</bug_when>
    <thetext>Bug fixed and committed to cvs</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>