Re: text/html for html and xhtml

William F Hammond <hammond@csc.albany.edu> hodd gsachd:

> The logical way to go might be this:
>
> If it has a preamble beginning with "^<?xml " or a sensible
> xhtml DOCTYPE declaration or a first element "<html xmlns=...>",
> then handle it as xhtml unless and until it proves to be non-compliant
> xhtml (e.g, not well-formed xml, unquoted attributes, munged handling
> of xml namespaces, ...).

So your assumption is such markup indicates a significant likeliness
of well-coded and well maintained (x)html files? Thats wrong. Such
markurp is exported from office software, generated by PHP scripts,
created by authoring tools and past & copied around the web.

Any tiny code change or typo could change parsing completely in some
new UAs, perhaps without the autor's notice. If the author notes, s/he
perhaps hadn't any clue what's going on, besides "this new browser is
rubbish".

> At the point it proves to be bad xhtml reload
> it and treat it as "regular" html.

This opens a can of worms (scripts are executed before...)

> So most bogus xhtml will then be 1 or 2 seconds slower than good xhtml.

Causes global warming  :-)

> Astute content providers will notice that and then do something about it.
> It provides a feedback mechanism for making the web become better.

Less astute content providers will suggest their users using other UAs
or disabling hidden user prefs.

j.j.

Received on Thursday, 17 April 2008 06:39:10 UTC