Re: <link> tag not validating properly?

At 2001-06-24T15:20-0400, Kenneth Wright wrote:-

> I have a test page at <http://web.kenandcorey.com/t.htm> that does not pass
> validation for HTML 4.01. It does not like the trailing slash on my link
> tag.
>
> I want my page to be valid in both HTML 4.01 transitional, and XHTML 1.0
> transitional, but with the slash it fails HTML4, and without the slash it
> fails XHTML1.
>
> Have I encountered a bug in the validator, or am I missing something?

It's not a bug. The / is required by XHTML, but makes the document invalid
HTML (since the SGML shorthand markup rules mean that the / closes the
tag, leaving the > as textual content where it is not allowed). Leaving
out the / makes the document valid HTML, but then XML requires a closing
tag, which is not allowed in HTML for EMPTY elements. You just can't have
both at once (even ignoring that you can only have one doctype at a time
anyway).

Tim Bagot

Received on Sunday, 24 June 2001 19:54:19 UTC