W3C home > Mailing lists > Public > www-tag@w3.org > December 2011

Opera reparses as HTML when XML parse fails

From: Noah Mendelsohn <nrm@arcanedomain.com>
Date: Tue, 13 Dec 2011 22:55:53 -0500
Message-ID: <4EE81E49.5090705@arcanedomain.com>
To: "www-tag@w3.org" <www-tag@w3.org>
CC: Sam Ruby <rubys@intertwingly.net>, Norm Walsh <ndw@nwalsh.com>
Of possible interest to those wrestling with HTML/XML interop:

 From Andreas Bovens [1] by way of Sam Ruby's blog [2] (the latter has an 
interesting comment thread). Opera is, at least in some cases, punting back 
to a forgiving HTML parse when strict XML rules result in an error.

The situation they're dealing with is a bit odd. Quoting Andreas:

"...certain sites seem to be sending their content [to Opera] with a MIME 
type of application/xhtml+xml, whereas they send the same content to other 
browsers with a MIME type of text/html. The reason for this is unclear, but 
it certainly has to do with broken server-side browser sniffing. We've 
identified that the issue occurs on certain versions of ASP.NET, but there 
are also other examples where only Opera gets application/xhtml+xml, while 
other browsers get text/html.

Now, application/xhtml+xml content would not give any trouble if the XHTML 
code on these sites was well-formed, but unfortunately, mistakes are easily 
made..."

"[...]"

"Hence, we've decided to stop throwing draconian XML parsing failed error 
messages, and instead, attempt to reparse the document automatically as 
HTML. Instead of showing an error message in the browser, it's now dumped 
to the console, so as a developer, you can still find XML parsing error 
warnings in Opera Dragonfly and the Error Console if you want to."

Noah

[1] http://my.opera.com/ODIN/blog/2011/09/28/no-more-xml-parsing-failed-errors
[2] http://intertwingly.net/blog/2011/10/03/No-more-XML-parsing-failed-errors
Received on Wednesday, 14 December 2011 03:56:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:48:41 GMT