Gazza <news@[EMAIL PROTECTED]
> wrote:
> chromatic_aberration mumbled the following on 01/02/2006 13:43:
>> I "discovered" some time ago, that closing <br> and <img [...]>
>> tags (i.e. <br /> and <img [...] />) in an HTML 4.01 Strict
>> document, actually *validates* on the W3C markup validator...
- -
> The browsers, and in this case, the validation script see the "/"
> as just another attribute.
No, the wowsers just skip it since they don't understand it.
A validator does something completely different: "/" terminates a tag,
and the following ">" is treated as character data. For a more detailed
explanation, see http://www.cs.tut.fi/~jkorpela/html/empty.html
> Technically XHTML shouldn't have a space before the /
> e.g. <br/>
Technically it should, according to the (in)famous Appendix C.
> but then the parser doesn't know an element called
> "br/".
The point is that some wowsers choke on it.
> It doesn't hurt to have these close these empty elements, but it
> would be best to either use an XHTML DTD, or stick with /plain/
> HTML.
Sorry, but that does not make much sense.
XHTML is not suitable for delivery of content on the WWW. Simple as
that. If you have some pseudo-religious reason to use it, you need to
play by Appendix C rules so that it looks like HTML as much as
possible.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


|