
Figure 3.2: The tree for the address
Benefits of the DTD
The main benefits of using a DTD are
• The XML processor enforces the structure, as defined in the DTD.
• The application accesses the document structure, such as to populate
an element list.
• The DTD gives hints to the XML processor—that is, it helps separate
indenting from content.
• The DTD can declare default or fixed values for attributes. This might
result in a smaller document.
Validating the Document
You can validate documents with an XML processor. I invite you to down-
load XML for Java from the IBM Web site at www.alphaworks.ibm.com.
There are other XML processors, but I will use the IBM ...