This chapter provides tutorial notes and example codes on DOM (Document Object Model). Topics include introduction to DOM programming interface; Java implementation of DOM; DOM Core specifications; Java example of parsing XML files; printing DOM Node tree; building new Document objects; converting Document objects to XML files.
DOM (Document Object Model) is an Application Programming Interface (API) that represents an XML file as a document object.
DOM has 4 levels of specifications. Currently, most applications are supporting DOM Level 1.
A DOM document object is really a tree of node objects. There about 12 node types that all share the same node interface.
JDK 1.4 has built-in support of DOM interface that allows you to parse XML files, create document objects,
or convert document objects back to XML files.