Re: HTML validator indicates false positives?

nex@o-slash.org wrote:

>when i validated the project antville site [1] with the HTML validator,
>it found more errors than there really are [2]. it seemingly failed to
>recognize a few opening tags. e.g. consider the first ten lines of the
>document: [...]
>
>6: <link rel="alternate" type="text/xml" title="XML"
>         href="http://project.antville.org/rss10" />
>[...]
>looking at this, i cannot explain this error message:
>>Line 10, column 6: Error: end tag for element "HEAD" which is not open;
>>try removing the end tag or check for improper nesting of elements

You are using X(HT)ML syntax in a HTML 4.01 Transitional document. These do
not mic well. In particular, the "/" at the end of your "link" element
terminates the element leaving the ">" as character data. Since character
data is not allowed in the "<head>" section, this will implicitly terminate
the "head" section and open the "body" section. Thus, when it gets to your
"</head>" it notices that the "head" section has already been closed and
complains that it found an "end tag for element "HEAD" which is not open".

Simple, huh? :-)

-- 
"Temper Temper! Mr. Dre? Mr. NWA? Mr. AK, comin´
 straight outta Compton and y'all better make way?"            -- eminem

Received on Thursday, 24 October 2002 20:06:45 UTC