RE: Error handling: yes, I did mean it

On Wed, 30 Apr 1997 02:05:35 -0400 Terry Allen said:
>Who's on First:  This is purely a matter of interest, and maybe
>there's a flat answer I just don't know.  Does ISO 8879 or
>XML-lang define the method of parsing in such detail that parsers
>must begin at "the beginning" of a sequence of bytes and not
>at "the end" or somewhere in the middle?  If the instance is

ISO 8879 does require a left-to-right parse.  XML does not explicitly
require LR parsing directly, and I'm not aware of anything in the
spec which either (a) requires LR parsing to work right or (b)
becomes nonsensical if parsing is non-directional.  If I'm right,
it would be possible (though pointless, I think) to use a
non-directional or right-to-left parsing algorithm on XML.

><foo>
><bar>coasters, beer mugs, ashtrays</bar>
><bear>fur, growl</bear>
><porridge>oats, cream, brown sugar</porridge>
></foo>
>
>would it not be possible to construct a grove starting from
><bear> and exploring its context?  or by parsing <porridge>,
>then <bear>, then <bar>?  or it is required that one start
>with <foo>?  If not, the requirement that the parser
>die at the first error does not ensure that various parsers
>will die after having sprouted identical groves, which I take
>to be the intended functional effect of the Draconian stance.

It is indeed possible to construct a parse starting at some
point other than the left-most edge of the data stream.

On the other hand, it hardly matters, does it?  The whole point of
the Draconian solution is to ensure that whenever the processor
sees an error, the rest of the document disappears -- i.e. to
ensure that bad docs cannot be processed successfully.  Except in
the entirely imaginary case that a non-directional algorithm
only noticed an error as it processed the last byte (byte 513
in a 200-K file) and had already passed all the data to the
app, it doesn't matter when the error is detected.  One error,
one useless doc.  That is the promise and the threat of the
Draconian approach.

-C. M. Sperberg-McQueen

Received on Wednesday, 30 April 1997 22:09:54 UTC