W3C home > Mailing lists > Public > www-validator@w3.org > August 2001

Re: Suggestion: Check elment first, attribute second

From: Christian Smith <csmith@barebones.com>
Date: Thu, 2 Aug 2001 16:37:40 -0400
To: "'www-validator@w3.org'" <www-validator@w3.org>
cc: Bjoern Hoehrmann <derhoermi@gmx.net>
Message-ID: <20010802163740-b01010801-eee0289d-0910-010c@204.107.232.107>
On Thursday, August 2, 2001 at 9:24 PM, derhoermi@gmx.net (Bjoern
Hoehrmann) wrote:

> * Bryce Nesbitt wrote:
> > The validator first checks attributes, then the element.  This means
> > if I do something like:
> >
> ><csobj w="208" h="77" t="Button">
> >
> > I get a long series of complaints about each attribute ("w", "h", "t")
> > before I find that the validator actually does not understand the
> > <csobj>.  An improvement would be to check the element FIRST, and give
> > just one error message.
> 
> You should improve your page with a proper document type declaration if
> you want to use proprietary markup, then you'll get no errors, either
> for elements or attributes. But that's no HTML anymore...

Certainly that is true but I think for other reasons it would be better for
the validator to skip attributes in unknown elements.

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 ;-)

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

-- 
Christian Smith  |  csmith@barebones.com  |  http://web.barebones.com

He who dies with the most friends... Is still dead!
Received on Thursday, 2 August 2001 17:01:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:59 GMT