DOM Level 3
DOM Level 3 (DOM3) will finally add a standard load-and-save package, making it possible to write completely implementation-independent DOM programs. This package, org.w3c.dom.ls, is identified by the feature strings LS-Load and LS-Save. The loading part includes the DOMBuilder interface you've already encountered. The saving part is based on the DOMWriter interface. DOMWriter is more powerful than XMLSerializer. Whereas XMLSerializer is limited to outputting documents, document fragments, and elements, DOMWriter can output any kind of node at all. Furthermore, you can install a filter into a DOMWriter to control its output.
As shown by the method signatures in Example 13.3, DOMWriter can copy a Node object from memory into serialized ...
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