DTD problem, or validator problem?

I had just batch-processed a website to start moving it in the direction
from HTML 4.01 transitional to XHTML. In doing this, I made a whole slew
of changes which caused the HTML to stop validating. In looking at the
DTD, I don't see why this should be the case (but then, I'm no DTD
expert). I thought I would inquire here to see if anyone else had seen
this, and whether it was known to be a DTD error or an issue with the
validator. I didn't find anything in the ToDo list, or in the list archives...


One of the changes I was making was to replace markup for empty
containers with XHTML-friendly markup.

    So...  <hr>     becomes...  <hr />
   and...  <br>     becomes...  <br />

and so on with img, button, input, etc. So far so good.

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">
<html><head><title>This is OK by the Validator</title>
    <meta http-equiv="Keywords" name="Keywords" content="no slash">
</head><body><br /><hr /></body></html>




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html><head><title>This is *NOT* OK by the Validator</title>
    <meta http-equiv="Keywords" name="Keywords" content="slash" />
</head><body><br /><hr /></body></html>



When I look in the DTD, I don't see anything significantly different in
the declarations for HR and META... but then maybe it's there, but I
don't know what to look for.

Does anyone know whether the above-described behavior is a bug? If so,
is it in the DTD, or in the validator?

thanks :)
-matt

Received on Wednesday, 15 August 2001 13:08:00 UTC