5.4.2 General Procedure for Creating the Sample Program
The following figure shows the general procedure for creating a sample program that uses the DOM parser.
-
Create a Document object.
Create a new Document object.
-
Create the Document node.
By using the Document object you created in step 1, create the Document node that is the parent of the DOM tree.
-
Create the Element nodes.
Create the necessary Element nodes from the Document node to create the DOM tree.
-
Create the Text nodes.
Create the character strings that are the contents of the elements.