Re: Suggestion: Check elment first, attribute second

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 UTC