XML-3 J. Teuhola 2013 37
- 3. Defining the document structure (DTD)
- Declaration of application-specific names and structural
constraints
- A document is valid if it specifies a DTD, and if its
contents conform to the DTD.
- A validating parser does the checking;
but: validation is not mandatory
- Items not specified in the DTD are forbidden
- A DTD does not specify: the root, precise number of
element instances, data formats (everything is a string; some restrictions on names), semantics (meaning)
- Alternative to DTD: XML Schema (see later)