W3C home > Mailing lists > Public > w3c-sgml-wg@w3.org > May 1997

Re: Betting our lives on error handling

From: <lee@sq.com>
Date: Fri, 9 May 97 15:08:19 EDT
Message-Id: <9705091908.AA07454@sqrex.sq.com>
To: w3c-sgml-wg@w3.org
> >Most modern C compilers do this sort of error recovery,
> >now forbidden in XML.
> 
> It is *not* forbidden in XML!
> 
> The wording proposed and adopted says explicitly that the XML
> processor may continue to process the data stream and report
> further errors.  It is required only to stop feeding the garbled
> data to the downstream application.

It depends on where the parser stops and the appliication begins.
For example, an error correcting C compiler might have a C parser that
communicates with a separate error handling mechanism, which in turn
communicates with the lexical tokeniser.  So yes, this is forbidden.

> This seems to me entirely analogous to the behavior of a compiler
> whose lexer and parser trudge on seeking errors while no longer
> bothering to feed the parsed source to the code generator.
Yes, I agree, and if that is legal, that's fine.

But an XML data storage repository had better be able to store a
broken document until I have time to fix it, please.

> >Even SGML does not forbid error recovery.  In fact, SGML's behaviour
> Nor does XML, in cases of errors other than WF errors.
So I don't really see the point of all this.

> On the other hand, the quality of error recovery exhibited by the SGML
> software I've used when confronted with the equivalents of WF errors is
> -- how can i say this delicately? -- not the world's most persuasive
> argument for SGML or for error recovery.

Author/Editor lets you edit invalid files.  There are two cases:
(1) it's not well formed (not what I call "plausible").
    In that case, Author/Editor does not stop processing the file: it 
    opens it in a "text mode" buffer.
(2) it's "plausible" SGML, but may have elements where the DTD doesn't
    allow them, missing required elements, etc.
    In that case, the parser doesn't stop either: the document is
    opened in Author/Editor icons and all.

Are these behaviours OK??

> It always surprises me when any error message after the first is even
> coherent. If your mileage varies, then good luck to you.

The issue is more what happens to the data, I think.

Lee
Received on Friday, 9 May 1997 15:08:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:26 UTC