W3C home > Mailing lists > Public > w3c-sgml-wg@w3.org > October 1996

Re: D.1 Distinguish partial and full DTDs?

From: <lee@sq.com>
Date: Thu, 24 Oct 96 17:37:24 EDT
Message-Id: <9610242137.AA25341@sqrex.sq.com>
To: U35395@UICVM.UIC.EDU, w3c-sgml-wg@w3.org
> D.1 What behavior should XML systems exhibit if no DTD, or only a
> partial DTD, is given with a document?

There are four cases worth considering for partial DTDs:
(1) the DTD covers everything in the instance
    (e.g. it's a subset of DOCBOOK)

    This is a full DTD as far as the instance is concerned...

(2) there are elements in the instance not in the DTD, or
    attributes, entities, or other wilde beasties.  But
    at least some names in the DTD correspond to the instance.
    The DTD, in other words, is a strict subset of the one that
    an SGML parser would need to parse and accept this instance.

    In this case, there are two main possibilities.
    (2a) the undefined names are errors; the instance (or DTD) is invalid
    (2b) the undefined names are accepted, as if they were declared
	 automatically and implicitly.

    I would strongly favour 2b.

(3) there is a DTD, but no names in the instance are actually used
    in the document.  This is indistinguishable from having the
    wrong DTD, and arguably could be an error.  But in practice it
    is the same as having no DTD, for all the good it does.

(4) there is no DTD.  This is the case if a partial DTD is actually
    empty, for example.

It seems to me that cases 2, 3 and 4 are all similar in that there are
names in the instance that have not been explicitly declared in an
actual manifestation of a DTD.  If case (4) is supported, cases (2) and
(3) also should be supported, and route (2b) should be taken.

> In particular, should there
> be a way to distinguish a document instance for which a DTD exists
> but is not given from an instance for which no DTD exists?

I think that's a question of philosophy.  You can only distinguish
between where you have or can get a DTD,
and where you don't have one and can't get one.

If you don't have a DTD, you're in the same position as if you had
an empty DTD.  You can read (as long as we don't screw up the
XML definition) but not validate.

If you work with SGML tools, you'll of course have a program to
create an SGML DTD from an XML instance, as otherwise you couldn't
use XML files with SGML tools.

Received on Friday, 25 October 1996 10:30:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:25:04 UTC