DOM - Creating Documents

andyclar at andyclar at
Fri Apr 23 19:12:45 BST 1999

Please pardon my tardiness -- I only follow the digest form of
this list.

As other people have already mentioned, it IS possible to build
DOM document objects programmatically using the IBM XML4J parsers,
version 1 and 2.

In version 1, the implementation is
This DOM 1.0 implementation has the benefit of additional non-DOM
functionality. For example, getting a (hash) digest value for any
subtree, namespace support, and content model objects stored under
the DocumentType object. This version of the DOM is supported in
the new version of the parser for compatibility with the older

In version 2, the implementation is
This is a "vanilla" DOM in the sense that it's primary goal was
to fulfill only the basic requirements of the DOM specification.
It handles default attribute values by having ElementDefinition
(non-DOM) nodes under the DocumentType. Additional features have
been delayed in order to see what falls out of the W3C working
groups on matters such as how the document grammar is stored in
the Document.

For both versions, there is no factory method for creating the
Document instance. You have to use the constructor. We did add
a convenience method to the version 2 DOM parsers that allows
you to set the document implementation by class name. When you
do this, however, you don't get the performance benefit of lazy
evaluation of document nodes.

Andy Clark * IBM, JTC - Silicon Valley * andyclar at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list