[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] Error and Fatal Error
- From: Liam R E Quin <liam@w3.org>
- To: stephengreenubl@gmail.com
- Date: Mon, 18 Jul 2011 09:34:58 -0400
On Mon, 2011-07-18 at 08:38 +0100, Stephen D Green wrote:
> Thanks Liam, but it seems the spec also seeks to cater for the use case
> where the conforming XML parser is used as a first step to repairing
> errors, isn't it?
No. The XML parser tells you whether your input conforms to the
specification.
> it seems document-centric use cases somehow
> cloud the issue, which I respect if it was the primary scenario of XML).
Pretty much the only scenario in fact. At any rate, the use case of
random unknown humans typing markup into an HTML form in a Web browser
and the developer wanting to hand that off to other tools without
checking it at all was indeed not considered.
The use case of random unknown humans typing (C code, SQL, assembly
code, ...) into text boxes was not considered by the respective language
designers either, many of whom would have had very little patience for
the idea.
Instead, give people a JavaScript-based front end to edit markup, ala
wordpress, and then if the markup isn't well-formed, e.g. because they
didn't go through the javascript front end, simply reject it on the
server.
You are asking compiler technology to do things it doesn't generally do.
XML might look superficially like HTML, since they share a common SGML
ancestry, but it is used very differently. Neither SGML not XML support
automatic error correction. XML does not forbid it, as long as the
parser notifies the application that the input is not in fact
well-formed XML, but the result is no longer defined by the XML
specification of course.
I did actually use a C compiler with error recovery built in, a long
time ago. I liked it, but, if an error was corrected, it did not
generate code - the correction was used to give clearer messages.
Liam
--
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]