RE: Validating dynamic sites

by Andrew McFarland <aamcf(at)aamcf.co.uk>

 Date:  Sun, 15 Sep 2002 20:14:44 +0100
 To:  <hwg-basics(at)hwg.org>
 References:  S0026260871
  todo: View Thread, Original
At 09:23 15/09/02 -0400, Brian V Bonini wrote:
<snip/>
>If your validating against the xhtml dtd remember that meta tags need to end
>with  />
<snip/>

And if you are using HTML meta tags must NOT end with />, just >.

It sounds like this is what the problem is.

Consider this document:

<html>
<head>
<title>Foo</title>
<meta />
<style></style>
</head>
<body>
</body>
</html>

That will be fine if you want it to be XHTML. However, if you treat this as 
HTML, the following happens:

<meta /> is really equivalent to <meta> >

The Trailing > is not part of a tag and is therefore text.

You can't have text in the head, so the parser assumes that the head is 
closed and the body is open

The style element is therefore in the body

You can't have styles in the body, hence the error.

Andrew

--
http://aamcf.co.uk/

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA