W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1999

Re: Comments on DOM 2

From: Arnaud Le Hors <lehors@w3.org>
Date: Thu, 16 Sep 1999 16:27:08 +0200
Message-ID: <37E0FE3C.F2424A3D@w3.org>
To: Dieter Köhler <dkoehler@ix.urz.uni-heidelberg.de>
CC: "www-dom@w3.org" <www-dom@w3.org>
Dieter Köhler wrote:
> 
> COMMENT ON § 1.2.
> 
> IMO the createDocumentType method should be placed in the Document
> interface, since a DocumentType node is considered a child node of a
> Document node.  It has to be inserted into the document tree, because
> its position in the XML Document is not fixed as the follwing example
> shows:
> 
> <?xml version = "1.0" encoding = "UTF-32" ?>
> <!-- comment 1 -->
> <?ProcessingInstruction ... ?>
> <!-- comment 2 -->
> <!DOCTYPE ... >
> <!-- comment 3 -->
> <!-- comment 4 -->
> ...
> 
> So it would be better to treat it like every other node which can be
> part of the document tree.
> 
> Therefore, also the createDocument method of the DomImplementation
> interface should not contain any doctype parameter. Instead, the
> application should be responsible for creating a Document Type node with
> the above suggested method of the Document interface, and add it to the
> child nodes of the Document node which created it.

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.
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.
-- 
Arnaud
Received on Thursday, 16 September 1999 10:27:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:46 GMT