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

Re: Comments on DOM 2

From: David Brownell <david-b@pacbell.net>
Date: Wed, 01 Mar 2000 11:30:09 -0800
Message-ID: <38BD6FC1.8B3756BB@pacbell.net>
To: Dieter Köhler <dieter.koehler@ppp.uni-bamberg.de>
Cc: Arnaud Le Hors <lehors@w3.org>, "www-dom@w3.org" <www-dom@w3.org>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:28 UTC