Summary
DOM is designed around the abstract-factory design pattern. The DOMImplementation interface is the abstract factory that creates implementation-specific instances of the Document and DocumentType interfaces. A vendor-specific DOMImplementation object can be retrieved by JAXP, by vendor-specific classes, or by the DOMImplementationRegistry class in DOM3.
The Document interface is in turn an abstract factory that creates implementation-specific instances of Element, Text, Comment, Attr, ProcessingInstruction, EntityReference, CDATASection, and DocumentFragment. Each instance of these classes can only be part of the Document that created it. However, the Document interface also has an importNode() method that copies a node from one document ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access