![]() |
NOTE:
These slides have not been updated since 2003. They have been superseded by the book
Anders Møller and Michael Schwartzbach, February 2006 |
<!ELEMENT collection (description,recipe*)> <!ELEMENT description ANY> <!ELEMENT recipe (title,ingredient*,preparation,comment?,nutrition)> <!ELEMENT title (#PCDATA)> <!ELEMENT ingredient (ingredient*,preparation)?> <!ATTLIST ingredient name CDATA #REQUIRED amount CDATA #IMPLIED unit CDATA #IMPLIED> <!ELEMENT preparation (step*)> <!ELEMENT step (#PCDATA)> <!ELEMENT comment (#PCDATA)> <!ELEMENT nutrition EMPTY> <!ATTLIST nutrition protein CDATA #REQUIRED carbohydrates CDATA #REQUIRED fat CDATA #REQUIRED calories CDATA #REQUIRED alcohol CDATA #IMPLIED> |
By inserting:
<!DOCTYPE collection SYSTEM "recipes.dtd"> |
in the headers of recipe collection documents, we state that they are intended to conform to recipes.dtd.
Alternatively, the DTD can be given locally with <!DOCTYPE collection [ ... ]>.
This grammatical description has some obvious shortcomings: