Re: Head section 'not open'

Paul Wicks <Paul.Wicks@ilt.ac.uk> wrote:

> If I use an xml style empty element in the head section of a document, i.e.
> <link ... /> or <meta ... /> the validator appears to interpret this as the
> end of the head section in an HTML 4.01 transitional document. Is this a bug
> in the validator,

No.  The SGML declaration of HTML 4.01 says "SHORTTAG YES", which allows
shorthand markup like null end-tag (NET).  However, the NET delimiter is
"/", so "<link ... />" is an equivalent of "<link ... >>" and the last
">" is just treated as character data.  Since the content model of
the head element doesn't allow character data as a direct child,
the validator interprets this as the end of the head element and
treats that there are implied "</head>" and "<body>" between "/" and ">".

> or can I not have a document that is both compatible with
> xhtml and html4.01?

No.

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium

Received on Wednesday, 27 February 2002 06:50:04 UTC