Show TOC

 Building DOM Trees from a DocumentLocate this document in the navigation structure

Use

Use this procedure to build a DOM tree from a Document instance. The following classes are closely related to this process:

  • javax.xml.DocumentBuilder
  • org.w3c.dom.Document
  • org.w3c.dom.Node
Procedure

To build a DOM tree, you have to take an empty Document instance:

  1. Get an instance of DocumentBuilderFactory .
  2. From this instance, get a new instance of DocumentBuilder .
  3. From the instance of the DocumentBuilder , invoke newDocument() .