What would be the best DOCTYPE to use these days?

Having written xhtml as an xml application for an intranet, I can tell you it is wondrous powerful. It has all the power of xml and it has the ease of authoring of html. Were MSFT not so obdurate, we would not be worrying over html5 right now beyond extending browser capabilities, e.g. canvas, video, etc., and a lot of css3 properties.




Why not write valid HTML with HTML4 strict doctype and tell the validator to check your document as if it were XHTML1 for the desired extra strictness, since that strictness is only valuable in the validator? I do this regularly, to catch typos like unclosed li’s or p’s.

Or does the validator miss some things unless you really do have the XHTML doctype?

The following short version of the doctype is valid for all versions of HTML between HTML 2 and HTML 4.01 and is the only part of the doctype that browsers actually care about.

<!DOCTYPE html>

If you are going to specify anything more in the doctype than that for HTML pages then only the validator is going to use it so it might as well be the value you want the validator to use.

I really was unhappy when they announced XHTML2 was being abandoned, given time I think it would have become a much more mature and relevant specification than HTML5 as it had a lot going for it. Plus it had some pretty exciting advances in store - unlike the new version of HTML which apart from canvas and video/audio it was mainly hyping about some DIV replacements to give semantic meaning we already achieved (to some extent) using ID “naming patterns”.

So was I. XHTML 2 offered some real benefits that would be achieved once browsers supported them.

HTML 5 isn’t adding anything that isn’t already available in HTML 4.01 (all it is doing is adding a few aliases for tags that already exist - mostly subsets of the <object> tag) and is in fact going backwards in some areas. Those tags that were deprecated in HTML 4 that have been added back in the HTML 5 draft were declared to be obsolete for a reason and that reason still exists.

One thing which REALLY bug’s me about HTML5 is the fact they deprecated the rev attribute (it played it’s part as a mirror opposite to rel - not role) because it had a genuine use for measuring anchor directions in social networking and Microformats (especially for search engines) to understand the relationships between pages. I know it was abused and poorly adopted but it had real potential and with it gone there’s no replacement for it (I even debated this with the spec editor, lol). :slight_smile:

I knew they were reintroducing garbage tags that are unnecessary but I didn’t realise that they are also getting rid of useful attributes. Another good reason to ignore HTML 5 and stick with HTML 4.01 and another clear indication of how big a backwards step that HTML 5 is. There are just so many things that show that the people who are “designing” HTML 5 don’t have the first clue as to the purpose of HTML and shouldn’t be allowed anywhere near the web.