Summary
Serialization is the process of taking an in-memory DOM data structure such as a Document object and writing it out onto a stream as bytes or characters. DOM2 and earlier does not include any standard classes or interfaces for performing serialization. Consequently, every implementation of DOM must provide its own unique API for performing this necessary task. In Xerces, that need is filled by the XMLSerializer class. The OutputFormat class stores the various configuration options for an XMLSerializer, including encoding, white space added for “pretty printing,” line separator, maximum line width, which elements to output using CDATA sections, and more.
DOM3 finally adds a standard set of serialization interfaces. The DOMWriter interface ...
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