Re: HTML-Validator - Non-valid Code passes the check

Jens Schwartz wrote:

> ENTITY % Length "CDATA" -- nn for pixels or nn% for percentage length
 
> IMHO, following this definition the height and width attributes don't
> contain correct values because of the "px" notation.
> Am I right with this, or have I understood something wrong?

You are right, but when the W3C validator uses the DTD it means that
it checks CDATA, it would consider width="foobar" as valid.  It does
not read or rather not understand the comment in the DTD.

> another validator[4] recognizes the code above as non-valid.
[...]
> [4] http://validator.de.selfhtml.org/

Oops, I didn't know that selfhtml offers a validator.  But it is
obviously no pure DTD validator.  DTDs can't express details for
attribute values, e.g., URI is also CDATA, href="25%" is valid
as far as a DTD validator can judge it.

Test the selfhtml validator with some broken URIs, if it doesn't
report this it's a lousy wannabe-better-than-DTD validator... :-)  

 Frank

Received on Friday, 14 March 2008 16:15:12 UTC