January 2003
Beginner to intermediate
1200 pages
23h 42m
English
To declare the syntax of an element in a DTD, you use the <!ELEMENT> element like this: <!ELEMENT NAME CONTENT_MODEL>. Here, NAME is the name of the element you're declaring; CONTENT_MODEL can be set to EMPTY or ANY, or it can hold mixed content (other elements as well as parsed character data) or child elements.
Here are a few element examples—note the expressions starting with % and ending with ;. Those expressions are parameter entity references, much like general entity references, except that you use them in DTDs, not the body of the document (we'll see parameter entities in the next chapter):
<!ELEMENT direction (left, right, top?)> <!ELEMENT CHAPTER (INTRODUCTION, (P | QUOTE | NOTE)*, DIV*)> <!ELEMENT HR EMPTY> <!ELEMENT ...