View Full Version : Which doctype, please?

06-02-2009, 10:41 AM

I am trying out the validator.w3.org against a page I have on line and I get, among other errors, the following:

Mismatch between Public and System identifiers in the DOCTYPE declaration

from this recommended list http://www.w3.org/QA/2002/04/valid-dtd-list.html

which DOCTYPE should I be using. These Web pages will not be going online; my main concern is that they are compatble in Safari, IE6, 7, and maybe 8.

One or two of the 'errors' seem plainly wrong. For example, I haven't closed my head tags (when I have), haven't closed the html tags (when I have).

The page I have is here: http://stevehigham59.7host.com/ImageTest/page1Test.html

and it is clear that I cannot see the JavaScript images at the top of the page - nor is the text formatted using the style sheet I have (on my desktop I can see the images and text correctly formatted).

Thanks for any ideas.


06-02-2009, 12:46 PM
OK, read the doctype error message agein:

This document uses an inconsistent DOCTYPE declaration. The Public Identifier -//W3C//DTD XHTML 1.1//EN declares the XHTML 1.1 document type, but the associated System Identifier http://www.w3.org/TR/xhtml11 does not match this document type.

The recommended System Identifier for XHTML 1.1 is http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd.

But before you’re going to correct this I’ll have to say: If you define your document as XHTML 1.1 then you must not set the MIME type of the document to text/html, it must be of type “application xhtml+xml (http://www.w3.org/TR/xhtml-media-types/#application-xhtml-xml)”. However, Internet Explorer isn’t capable of parsing XML or XHTML for that matter so you need to send your documents as text/html which is only allowed in HTML and tolerated in XHTML 1.0.

So, to cut a long story short: Since you are already using XHTML type markup use an XHTML 1.0 strict doctype. Maybe the errors will be gone once the validator knows what kind of language you are using.

And as to styles and images: look at the file paths. My browser says it can’t find, for example, http://stevehigham59.7host.com/_common/css/main.css (as you have defined in your document).

06-03-2009, 01:51 PM
Hello Stephan

Thanks for your message.

I'll save your post because the DOCTYPES I have always found confusing - it never used to be like this!

Regarding the link I posted, the files work perfectly on my desktop in IE, FF, and Safari - the reason they don't work on a server is because they are seeking higher permissions.

Many thanks again.


06-03-2009, 03:44 PM
Another excellent reference -- including a section on choosing Doctypes : Activating Browser Modes with Doctype (http://hsivonen.iki.fi/doctype/)