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

Re: Suggestion: Check elment first, attribute second

From: Nick Kew <nick@webthing.com>
Date: Thu, 2 Aug 2001 20:27:00 +0100 (BST)
To: Bryce Nesbitt <bryce@obviously.com>
cc: www-validator@w3.org
Message-ID: <Pine.BSF.4.21.0108022003540.465-100000@fenris.webthing.com>

On Wed, 1 Aug 2001, 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>.

The reason for this is the event-driven parser used (basically James
Clark's SP).  The parser generates an event at the end of whatever
fragment of text generates the message, thereby avoiding what would
otherwise be lots of additional complexity and potential ambiguity.

So in the line
         <csobj w="208" h="77" t="Button">
                      1      2          34
events triggering parser messages are generated at 1, 2, 3 and 4 in
that order.

(readers whose mailer uses a proportional font - upgrade it now and the
above will make sense :-)

Given this, rearranging the messages in the validator is not easy.

Now, the W3 validator involves a Perl CGI script as a wrapper for
nsgmls (an SP parser application it uses to generate the messages).
The Perl script simply reports messages in the order they are generated,
and is already doing a rather complex and potentially error-prone job
parsing them   To do otherwise could be interesting, but would risk
breaking badly.

In my own work (Code Valet), I have taken an alternative approach of
modifying SP itself, and dispensing with the Perl wrapper.  In principle,
this approach offers the best prospects for substantial improvements 
to the message reporting.  However, it has proved a much harder
programming task, and useful results are slow coming.

You may wish to look at the discussion and code at
which I believe represents an important step in the rationalisation of
the validator messages.  But it's not (yet) what you're asking for!

Nick Kew

Site Valet - the essential service for anyone with a website.
Received on Thursday, 2 August 2001 16:10:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:30 UTC