Re: Using strict doctype

On 9 Mar 2001, at 13:08, Mikko Saari wrote:

> I don't know if I'm understood the function of HTML Tidy wrong, but I'm
> a bit annoyed by the error message "Warning: html doctype doesn't match
> content".

HTML Tidy attempts to make an invalid HTML document into a valid document.  
For example, if the document is marked with an HTML 3.2 doctype but 
contains an INS element, then there are two ways to make the document 
valid: Tidy could delete the INS element, or Tidy could change the doctype 
to HTML 4.01.  In this example, Tidy will use the second method.


> I'd like to know exactly what's wrong so I could make it a Strict
> document. 

If you want to ensure that a document is valid HTML for some version (e.g., 
4.01 Strict), then place the desired doctype in the document and use an 
HTML validator instead of Tidy:  

  http://validator.w3.org/

The validator will list every element and attribute that is not compatible 
with the version of HTML specified by the doctype.

If you prefer an off-line validator, I would recommend James Clark's NSGMLS 
program that is part of his SP package:

  http://www.jclark.com/sp/

...coupled with the W3C DTD:

  http://www.w3.org/TR/html4/strict.dtd

                                      -- Dave

Received on Saturday, 10 March 2001 01:53:35 UTC