Re: Suggestion: Check elment first, attribute second

From: Bjoern Hoehrmann (derhoermi@gmx.net)
Date: Thu, Aug 02 2001

  • Next message: Martin Duerst: "Re: Suggestion: Check elment first, attribute second"

    From: Bjoern Hoehrmann <derhoermi@gmx.net>
    To: Christian Smith <csmith@barebones.com>
    Cc: "'www-validator@w3.org'" <www-validator@w3.org>
    Date: Fri, 03 Aug 2001 02:42:11 +0200
    Message-ID: <49ojmt4od5avd04919skb8mvdsrke3k8hp@4ax.com>
    Subject: 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/