Re: Comments on DOM 2

Dieter Köhler wrote:
> Several months ago I raised the following question:
> > >
> > > COMMENT ON § 1.2.
> > >
> > > IMO the createDocumentType method should be placed in the Document
> > > interface, ...

I had a similar comment, showing the rather horrible situation
that folk are in today if they want to populate a Document with
a correct DocumentType .

> Arnaud Le Hors answered:
> > We've actually debated this over and decided otherwise. The reason is
> > that this would mean one would first create an untyped document and then
> > sets its type by inserting a DocumentType node in it. And possibly
> > change it again at any given time.

In short, the basic problem is that the current DOM APIs have two
ways to express "Document Type":  as a subtype of Document, and as
the real DocumentType object (which is however largely unusable in
the December CR).

One could eliminate the "change type" case by making that illegal.

> > However, changing a document type can have a huge impact on the
> > document, since it impacts entities and default attributes. For that
> > reason the type of the document is immutable and as to set at the time a
> > document gets created. Which is why the DOM interfaces have to be the
> > way they are.
> For the time being this convinced me, but in reconsidering the issue I
> was beginning to have doubts, because there is still the problem, how
> to represent processing instructions outside the root element in the
> DOM.  For example you are using a processing instruction to generate a
> DTD "on the fly".  This DTD is stored in a file while the Doctype
> definition of your document is pointing at that file.  (BTW:
> Generating a DTD on the fly is not as peculiar as you might think.
> Exactly that is being discussed at the Text Encoding Initiative, TEI,
> to meet the needs of scholars for adjusted DTDs.) 

As I'd commented in my post (archive URL above), there seems to be
an assumption that document type is an _external_ notion, which is
manifestly not the model of XML.  MIME does it that way, for a much
weaker notion of "type", though.

- Dave

Received on Wednesday, 1 March 2000 14:30:08 UTC