Matthias: blog
Das Logfile über mein Leben im Netz.

HTML4 loose.dtd is not broken Mittwoch, 03. Mai 2006, 13:20:38

Bertrand wonders whether the HTML4 loose.dtd is broken on W3C.ORG:

After getting weird HTML validation errors today we had a look at the http://www.w3.org/TR/html4/loose.dtd and it seems like it's broken!

Is it just me? The DTD contains things like


!ENTITY % ContentType "CDATA"
    -- media type, as per [RFC2045]
    --

With a comment closing sign, but no opening. Validators fail with an error on the first entity declaration, "HTML.Version".

Well, it's not broken. The document he's writing about is not an HTML document. It's a DTD, an SGML Document Type Definition; the document in question is the definition of one version of HTML, namely HTML Transitional. And the code sample above is an Parameter-Entity Definition.

That's also the reason why an HTML validator will say it's not valid HTML - because it's not HTML at all :-).