W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2000

Re: Comments on DOM2 CR

From: David Brownell <david-b@pacbell.net>
Date: Mon, 06 Mar 2000 10:35:01 -0800
Message-ID: <38C3FA55.71BD721D@pacbell.net>
To: Jeff Mackay <jmackay@vtopia.com>
Cc: www-dom@w3.org
Jeff Mackay wrote:
> >>       Since a Document's context is mostly defined by the
> >> DOMImplementation, we put the factory there. We could have put it on
> >> DocumentType, but DocumentType is optional.
> >
> > And anyway, DocumentType as factory for Document would be wrong
> > since the contained object can't create its container.
> Maybe another abstraction is in order.  How about introducing a
> 'DocumentSchema' interface that represents a specific class of documents.

What sort of schema?  RELAX, RDF, SOX1, SOX2, MS-Schema, W3C-Schema, ... ?

In any case, support for all of those would be a post-L2 issue, since
many of them aren't even stable yet.

> I think this would eliminate the chicken and egg problem.

Nope, see my original posting on the chicken/egg problem and you'll
see why anything short of having the Document be the factory for its
DocumentType is not practical:


There's a direct translation to schemas, too -- except that it's
likely worse.  Anyone reading a document isn't going to know the
schema to use until it's partly parsed, just like they're not going
to know the DocumentType to use until "late" either.  With DTDs you
only need to read through the root element start tag.

With schemas, depending on how they're associated with the document,
you may need to read much more deeply into the document text before
you can start to create the DOM Document object.  For example, if a
schema were wholly embedded in the document, you'd have major trouble.

- Dave
Received on Monday, 6 March 2000 13:35:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:06 UTC