Locating a DOMImplementation

So far, I've deliberately avoided the crucial question of how one creates a DOMImplementation object in the first place. Because DOMImplementation is an interface, not a class, it cannot be instantiated directly through its own constructor. Instead you have to build it in one of three ways:

  • Construct the implementation-specific class.

  • Use the JAXP DocumentBuilder factory class.

  • Use the DOM3 DOMImplementationRegistry factory class.

Implementation-Specific Class

Directly constructing an instance of the vendor class that implements DOMImplementation is the simplest of the three alternatives. However, the name of this class and how it's created vary from one implementation to the next. For example, in Xerces the org.apache.xerces.dom.DOMImplementationImpl ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.