Re: Bug in validator?

It seems to me that the following problem has not been addressed at the
detailed level, although the general advice of not using <BR /> like
notations with non-XHTML doctypes has been given (and helps to avoid the
problem).

On Tue, 8 Jul 2003, Chris wrote:

> Sorry, it's behind a login, so I can't post a URL, however, here is a
> larger chunk of the code.

Generally, I think anyone asking for help with validating a page should
take the trouble of uploading a copy of it onto the Web, when needed.

> <p/>

This is the heart of the matter, in the technical sense. Using the WDG
validator http://www.htmlhelp.com/validator/ gives a hint:

<p/>
  ^Warning: net-enabling start-tag; possibly missing required quotes
around an attribute value

I'm afraid I'm partly guilty of that particular formulation, since I have
mentioned that the situation where a validator thinks that there's a NET
enabling start tag _typically_ results from not quoting an attribute
value, as explained in my "Saga of the slashed validators",
http://www.cs.tut.fi/~jkorpela/qattr.html

In this case, the informative warning is partly misleading, since the
problem results from the use of <p/>, presumably meant to serve as an
empty p element (for some odd reason - such elements are explicitly
frowned upon in HTML specifications, though they are formally valid).

What happens when a validator sees <p/> is that it treats it as starting a
construct of the form
<p/.../
which is, by SGML rules, a valid shorthand for
<p>...</p>
Hence, the first slash "/" in the character data content is taken as NET
(Null End Tag), as </p>, which in this case means that the p element would
be closed even though an a element inside it has not been closed - thus,
"end tag for "A" omitted, but its declaration does not permit this".

-- 
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

Received on Tuesday, 15 July 2003 17:05:05 UTC