Re: DTD problem, or validator problem?

At 2001-08-15T12:07-0500, Matthew Wickline wrote:-

> The problem is that meta and link are also empty containers. However,
> updating those tags results in pages which no longer validate. The
> following examples show a page with updated br and hr tags. The first
> one does not have an updated meta tag and validates. The second one has
> an updated meta tag and no longer validates. (The slash in the meta tag
> seems to imply that the body element has begun, which makes the closing
> head tag an error, as well as the starting body tag.)
>
>
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>     "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

You are telling the validator that the document should be interpreted as
HTML 4.01 (though not using the usual doctype declaration), so it
interprets it as such, and not as XHTML. A subtle difference between SGML
(with HTML's SGML declaration) and XML means that a tag <empty/> is
terminated in XML by the '>', but in SGML by the '/', so that the '>' is
interpreted as character data, which is not permitted by the content model
for the head element.


Tim Bagot

Received on Wednesday, 15 August 2001 16:33:15 UTC