A DTD file provides constraints on a XML document structure. A DTD file lists elements, attributes, entities, and notations for an XML document. A DTD file specifies relationships between components. A DTD specifies cardinality and null constraint. However, a DTD file does not contain any data or datatypes.
When you import a DTD file, you can change the datatypes for the elements in the XML definition. You can change the null constraint, but you cannot change element cardinality.
If you import an XML file with an associated DTD, the Designer creates a definition based on the DTD structure.
The following figure shows an example of an XML file where StoreInfo.dtd contains the Store element and Product is one of the child elements of Store:
The following figure shows the associated DTD:
In the associated DTD, ProductInfo.xml, uses the Product element from StoreInfo.dtd. Product includes the multiple-occurring Sales element.
The following figure shows the source definition that the Designer creates:
The ProductInfo definition contains the Product and Sales groups. The XML file determines what elements to include in the definition. The DTD file determines the structure of the XML definition.