Issue with QDomDocument::setContent and XML declaration attribute quotes
<p>I'm having an issue when importing an XML document from a string.</p>

<p>The XML declaration/preprocessor has two attributes (version, encoding) which are defined within double-quotes.
However, on creating a QDomDocument via the setContent method, the double-quotes are replaced with single-quotes but only for the declaration/preprocessor element, the root element attributes still use double-quotes.</p>

<p>QDomDocument::toString() :</p>

<pre><code>packet : 
"&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;pkt uniqueID="fe87d654-dded-44e6-8c6a-70c92ebd4d7d" version="1"&gt;
 &lt;inner uniqueID="dca0ddd7-2e91-492f-b61c-d4962a003dd9"&gt;
  &lt;element&gt;value&lt;/element&gt;
 &lt;/inner&gt;
&lt;/pkt&gt;"
</code></pre>

<p>QDomDocument::SetContent(...) ... toString() :</p>

<pre><code>getPacket : 
"&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;pkt uniqueID="fe87d654-dded-44e6-8c6a-70c92ebd4d7d" version="1"&gt;
 &lt;inner uniqueID="dca0ddd7-2e91-492f-b61c-d4962a003dd9"&gt;
  &lt;element&gt;value&lt;/element&gt;
 &lt;/inner&gt;
&lt;/pkt&gt;"
</code></pre>

<p>The data is being used in a transmission protocol where on the receiving end it needs to be verified via a checksum - this verification will fail due to the conversion from double-quotes to single-quotes.</p>

<p>Any ideas on how I can preserve the use of double-quotes across conversion?</p>

<p>Thanks</p>

<p>See code below used to recreate the issue:</p>

<pre><code>int main( void )
{
    QDomDocument packet = pDoc.document();
    QString stringPacket = packet.toString();
    qDebug() &lt;&lt; "packet :" &lt;&lt; endl &lt;&lt; stringPacket;

    QString errorMessage; int errorLine; int errorColumn;
    QDomDocument getPacket;
    if( !(getPacket.setContent( stringPacket, &amp;errorMessage, &amp;errorLine, &amp;errorColumn)) )
    {
        qDebug() &lt;&lt; "!! error !!" &lt;&lt; endl
                 &lt;&lt; "message :" &lt;&lt; errorMessage &lt;&lt; endl
                 &lt;&lt; "errorLine :" &lt;&lt; errorLine &lt;&lt; endl
                 &lt;&lt; "errorColumn :" &lt;&lt; errorColumn;
    }
    qDebug() &lt;&lt; "getPacket :" &lt;&lt; endl &lt;&lt; getPacket.toString();
}
</code></pre>