Re: Suggestion: Check elment first, attribute second

* Christian Smith wrote:
>Consider
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
><html>
><head>
>	<title>A test page</title>
></head>
><body>
><o dir="ltr">
>Opps, I goofed.
></p>
></body>
></html>
>
>Now, the validator will complain that there is no attribute "dir" in the
>element "o" in this version of HTML. Well, duh, there is no element "o" in
>this version of HTML ;-)

Consider this additional definition in some custom DTD:

  <!ATTLIST o
    dir (ltr|rtl) #IMPLIED
  >

Now the Validator would only complain about the the missing element
definition, if you also add

  <!ELEMENT o - - (#PCDATA)>

The validator wouldn't complain anymore. That's SGML Validation.

>It's not useful to report this and in some cases will make finding true
>errors harder. 

Both actually _are_ real errors and since we claim to use an SGML
Validation system, we must report such errors.
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/

Received on Thursday, 2 August 2001 20:43:17 UTC