If XML is used to transfer information between applications, there needs to be a mechanism for ensuring that the XML is not only syntactically correct but also is structurally correct. In fact, there are two common mechanisms for this:
Document Type Definitions
A Document Type Definition (DTD) is a way of defining the structure of an XML document. DTD elements can be included in the XML document itself or in a separate external document. The syntax used to define a DTD is different from XML itself.
The following is an example DTD that describes the jobSummary XML:
<!DOCTYPE jobSummary> <!ELEMENT jobSummary (job*)> <!ELEMENT job (location, description?, skill*)> <!ATTLIST ...