RE: Comments on DOM2 CR

>>	 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.

The DocumentSchema interface could be implemented with either an external
DTD or by a Schema. The DocumentType interface would refer to the
DocumentSchema.

So I'd ask the implementation to create a schema, ask a schema to create a
document that complies with that schema, tell the document to create its
document type, which references the schema that was used to create the
document.

I think this would eliminate the chicken and egg problem.

Received on Monday, 6 March 2000 11:53:40 UTC