HTML and CSS Reference
Content models can also define an element type as containing element content,
illustrated by the SGML declaration for a definition list ( <dl> ) under HTML 4.01:
<!ELEMENT DL - - (DT | DD)+>
The XML declaration for dl under XHTML is again only slightly different, as it omits the
minimization information and cases the elements differently:
<!ELEMENT dl (dt | dd)+>
A model group contains the names of the elements that a tag may enclose; for example, dt
and dd are found within <dl> tags. In this example we note the vertical bar separating dt
and dd . This is a logical connector —a special symbol indicating how the content units it
connects relate to each other. There are three logical connectors and one grouping
• | Means “or” (one and only one of the connected content units must occur)
• & Means “and” (all of the connected content units must occur)
• , Means “sequence” (the connected content units must occur in the specified
• ( ) Used to group content units together.
Thus, the content model for a definition list says that the <dl> tag must contain either a
<dt> or a <dl> tag and can contain any additional number of <dt> or <dd> tags.
Model groups can be nested inside other model groups. Very flexible content models
can be declared by combining this with the capability to qualify content units with
occurrence indicators and logical operators. The XHTML declaration for the <table> tag
illustrates this point:
<!ELEMENT table (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
The content model for the table element type reads as follows:
• Table content begins with zero or one <caption> tags.
• This must be followed by a content group.
• The content group must contain zero or more <col> tags or zero or more
• This must be followed by zero or one <thead> tags.
• This must be followed by zero or one <tfoot> tags.
• This must be followed by one or more <tbody> or <tr> tags.