Re: Suggestion: Check elment first, attribute second

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
<URL:http://valet.webthing.com/xml/>
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.
<URL:http://valet.webthing.com/>

Received on Thursday, 2 August 2001 16:10:42 UTC