DOMImplementation

The DOMImplementation interface, shown in Example 10.1, is an abstract factory that is responsible for creating two things—new Document and DocumentType objects. It also provides the hasFeature() method discussed in Chapter 9 that tells you what features this implementation supports.

Example 10.1. The DOMImplementation Interface
package org.w3c.dom;

public interface DOMImplementation {

  public DocumentType createDocumentType(
   String rootElementQualifiedName,
   String publicID, String systemID) throws DOMException;
  public Document createDocument(String rootElementNamespaceURI,
   String rootElementQualifiedName, DocumentType doctype)
   throws DOMException;
  public boolean hasFeature(String feature, String version);

}

For example, given ...

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.