to the main page... about these slides...

A note on DTDs

DTD: Document Type Definition

- a way of describing classes of XML documents (like grammars for other languages)

Serious problems with DTD:

A tiny example DTD:
 <!DOCTYPE recipecollection [
   <!ELEMENT recipe (title,author?,date?,description,ingredients,preparation,related)>
   <!ATTLIST recipe id       ID                                       #REQUIRED
                    category (breakfast|lunch|dinner|dessert|unknown) #IMPLIED>
   <!ELEMENT title (#PCDATA)>
   <!ELEMENT author ANY>

The solution: schema languages (DSD, XML Schema, ...)

For the record:
Well-formed documents: conform to common XML syntax rules
Valid documents: well-formed + conform to given DTD