|
Posted by Jukka K. Korpela on 02/13/07 06:31
Scripsit Andy Dingley:
> Congratulations! You might be one of the very few people to ever post
> about validation problems here and to have actually exposed a real
> flaw in the validator.
Actually, no. He was however one of the few people who post about validation
problems and provide sufficient information, namely a URL.
> Your code is bogus, although probably not actually invalid.
It is actually invalid; see Rik's answers, or check
http://www.cs.tut.fi/~jkorpela/html/empty.html
(which discusses a more common problem, limited to XHTML-like syntax for
empty elements, where the issue is different - since a validator knows that
an HTML element like <br> has EMPTY declared content, it effectively treats
<br/> just as <br>> without looking for a matching "/").
> It's littered with <p /> <br /> and <hr /> tags.
Yes, that's the practical markup problem, and easy to fix.
> * Your <p> elements aren't empty, so the empty tag <p /> is wrong.
<p /> would be wrong even for an empty paragraph. By HTML rules, "<p /"
starts shorthand markup that will cause a matching "/" to be looked for. By
XML rules, "<p />" is a self-closing element, but the use of that syntax is
disallowed in XHTML that pretends to be compatible with "HTML user agents",
by the infamous Appendix C.
> It seems that the validator recently changed behaviours and started
> accepting <br /> as valid HTML, when it used to reject it outright.
Nope. I don't think there's any change. <br /> is formally valid HTML, it
just _means_ <br>>. It causes no error message. <hr /> might, in Strict HTML
4.01 in a context where only block-level elements are allowed, as directly
inside <body>, but that would be an error due to the ">".
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
[Back to original message]
|