Defining the rules


A valid XML document will reference a document type declaration (DTD) :

<!DOCTYPE cookBook SYSTEM "cookbook.dtd">

A DTD specifies:

  • names for all your elements
  • names and default values for their attributes
  • rules about how elements can nest
  • names for re-usable pieces of data (entities)
  • and a few other things

n.b. A DTD doesnot specify anything about what elements "mean"


11 Next | First| Previous XML: the refresher