Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does Opera parse my web page as XML?
    primarykey
    data
    text
    <p>I just tried viewing my website <a href="http://www.logmytime.de/" rel="nofollow noreferrer">http://www.logmytime.de/</a> in Opera (version 10.50) it gives me an "xml parsing failed error" and refuses to display the web page. </p> <p>I can choose to "Reparse the document as HTML" and then the page works fine, but that's hardly a solution to my problem.</p> <p>The weird thing is that the error still occurs after setting a HTML (instead of XTHML) doctype:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; </code></pre> <p>I checked the source output from the browser to make sure I did not make any mistake with the Doctype I even viewed the same web page in Firebug and it shows a Content-Type of text/html; . </p> <p>So, why does Opera still try to parse my web page as XML?</p> <p>Thanks,</p> <p>Adrian</p> <p><strong>Edit:</strong> Just to clarify: I am not asking what the error on my web page is. I understand why this is not valid XHTML. However, I am also using the <a href="http://ejohn.org/blog/javascript-micro-templating/" rel="nofollow noreferrer">javascript micro templating engine</a>, and it's templates are never valid XML, which is why I need the browser to parse my entire web site as HTML, not XHTML. In order to demonstrate this, I just inserted an example template into the web page.</p> <pre><code>&lt;script type="text/html" id="StopWatchTemplate" &gt; &lt;h1&gt;&lt;a href="#" onclick="TimeEntriesList.EditTimeEntry('&lt;#=timeEntryID#&gt;')"&gt;&lt;#=currentlyRunning?"Aktueller":"Letzter"#&gt; Stoppuhr-Zeiteintrag&lt;/a&gt;&lt;/h1&gt; &lt;%-- Stoppuhr - Ende--%&gt; &lt;/script&gt; </code></pre> <p>When opening the page in Opera, you can see that the template now produces XML parsing errors even though the doctype for the page is still HTML.</p> <p><strong>Edit 2:</strong>: Just to make this even clearer: I am not asking why my web page is not valid XHTML. I am asking why Opera tries to parse it as XHTML despite the HTML doctype.</p> <p><strong>Edit3:</strong>: Please do not post any more answers, I have found the cause of this and <a href="https://stackoverflow.com/questions/2766820/why-does-opera-parse-my-web-page-as-xml/2769462#2769462">documented</a> it below. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload