RE: Can Browsers Attempt to Render Broken XHTML?

I think this has been covered, but to summarize my understanding:

HTML is much less restrictive than XML/XHTML.

An XML parser _MUST_ fail by definition, thus the same will (should) hold
with XHTML since it must be well-formed XML.

An HTML parser can do whatever it wants... which is (maddeningly) why
certain things 'work' in IE and not in [insertOtherBrowserHere] - IE (read:
thousands of sloppy M$ programmers) can parse your poorly formed HTML and
decide what to do with it (e.g. display it anyway and continue); the reverse
is NOT true for XML/XHTML parsers. A simple example is:

<select name=color>
 <option>blue
 <option>red
</select>

works fine in most browsers, in a document declared as HTML. 
If the document is declared as XHTML, you should use:

<select name="color">
 <option>blue</option>
 <option>red</option>
</select>

If the 1st example works in a document declared as XHTML, it would be a
deviation from the 'strictness' that XML is supposed to guarantee.

As long as there are sloppy parsers, people can continue to write sloppy
code that 'works' - I hope eventually the 'Sloppy Code Support' "feature" in
current HTML parsers (browsers) will be eradicated, forcing everybody to
have well-formed markup.

The only impact that can be made on accessibility as we migrate to XHTML is,
for example, a Schema that the XHTML document is validated against can be
made to _FORCE_ attributes like longdesc (althought this would have to be
implemented at the corporate/organizational level as opposed to the internet
in general).

HTH.

Geoff Hoffman

Received on Thursday, 26 June 2003 13:42:20 UTC