Re: Comments on DOM 2

David Brownell wrote:

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

I totally agree with your archived post, that a DTD is something
internal to an XML document and that the DOM should has to be very
aware of that fact.  The problem now is, that the document node does
not represent the whole XML document, but only the part starting with
the root tag.  You suggested in your archived post, that the document
node should create the DocumentType node.  That is exactly the way my
experimental DOM implementation in Delphi (see the link in the
signature) handles it.

But when I was thinking about external DTDs, I found, that it might be
better to have a more flexible solution, because it could speed up
things if one is able to reuse the same DTD tree (Yes, DTD trees are
not defined in DOM1 or 2, as you know, but are implemented in my
experimental version) without having to rebuild the tree every time
one is parsing a new document.  For the reason of parsing external
DTDs the factory method for creating a documentType node should be
located in the DOMImplementation (or we need a special externalDTD
node).  So the application can keep a list of already parsed external
DTDs and re-use them on demand.  However, we need a better solution
for internal DTDs.

 Dieter Koehler, M. A. -
 Mittlere Kaulberg 22, D-96049 Bamberg, +49(0)951-5190726
 "": 1000+ Philosophie-Links
 "": Deutsche Philo-Links
 "": Open XML - XML-Komponenten fuer Delphi

Received on Wednesday, 1 March 2000 16:03:52 UTC