what's a parser's job? [was: RE: SD5 - Namespaces - New Version 2]

Andrew Layman <andrewl@microsoft.com> wrote:
[...]
> 	[Andrew Layman] This is the key question here. It is not the XML
> parser's job to detect namespaces. Applications that care will break out
> the namespace part of the name, and look for a matching namespace
> element. This could be a standard support routine shipped with parsers,
> but is not--strictly speaking--a parser's job. Similarly, I do not see
> validation as part of a parser's job, but as something that is (at least
> logically) layered on.

In the SGML world, the word "parser" does not mean "parser" as used
elsewhere in the field of computing.  It has a special, SGML meaning.
An SGML parser does indeed do validation.

Whether an XML parser (in the usual sense of the word parser) should do
validation is another matter entirely.

I agree with you that namespace checking doesn't belong in a (CS) parser.
It's part of the semantics layer, if you will.  But I wouldn't expect a
CS parser to check that an element had been declared either -- that would
be done in a separate module/class/layer.

In this mailing list at least, the word "parser" is generally taken in
the SGML sense, although I would agree that it isn't clear.

Would it help if the XML spec used different terminology?
E.g. the XML Input Reader and the XML Input Checker, or something??
(an SGML/XML parser contains both of these)

Lee

Received on Friday, 23 May 1997 22:09:54 UTC