Chapter 06
XML Validation: DTD
Goals:

We have seen that XML can describe nearly any data. It offers tremendous flexibility - nothng is predefined. The element names we use have no intrinsic meaning in the XML standard. We make them up as we go along, to describe our data.

Similarly, there are no rules about how the single document element organizes its component elements or how those elements are themselves composed. These are also established to fit the data being modeled.

In practice, this is fragile. To be useful, the producer and the consumer of an XML document must agree on the structure of the document and each of its elements. In this chapter we will learn to create formal explicit agreements on XML vocabularies.

Several formats have been proposed to formalize these designs. The original (and simplest) is the Document Type Definition (DTD). We will learn the syntax of DTD and we will use it to:

  • express a data design
  • validate compliance

These are other important uses to the DTD, and exposure to them is necessary for a solid understanding of XML. But these will not be used in Flash applications here or elsewhere. The Flash XML parser does not parse DTDs directly. Reliance on these techniques will create problems. So we will only briefly learn to use the DTD to:

  • create macro shortcuts
  • conditionally compile

 

 

Source

[Coming soon]

 

 

Examples

[Coming soon]

 

 

Reference

[Coming soon] 

 

 

Tools
[Coming soon]