Define validating parser
The example does this by echoing the DOM nodes, and then printing them out onscreen, with the appropriate indentation to make the node hierarchy apparent.
The specification of these node types can be found in the DOM Level 2 Core Specification, under the specification for The information in this table is extremely useful; you will need it when working with a DOM, because all these types are intermixed in a DOM tree.
They can afford to ignore comments, and they do not care whether data was coded in a CDATA section or as plain text, or whether it included an entity reference.
Most applications, however, are concerned only with the content of the XML structures.
In particular, you use the Document Builder db = Document Builder(); Output Stream Writer error Writer = new Output Stream Writer(System.err, output Encoding); Error Handler(new My Error Handler (new Print Writer(error Writer, true))); Document doc = db.parse(new File(filename)); does not do anything yet.
In the next section, you will see how to display the DOM structure and begin to explore it.
To create or manipulate a DOM, it helps to have a clear idea of how the nodes in a DOM are structured.
This section of the tutorial exposes the internal structure of a DOM, so that you can see what it contains.