The allowable content of the elements is shown using a content model syntax.
| ( ) || ( and ) are grouping symbols around elements and/or other symbols
| A | B || Either A or B occurs, but not both.
| A , B || Both A and B occur, in that order.
| A & B || Both A and B occur, in any order.
| A? || A occurs zero or one time.
| A* || A occurs zero or more times.
| A+ || A occurs one or more times.
| -A || A is prohibited at this point.
| +A || A could appear multiple times at various positions.
| EMPTY || this means that there must be nothing in the content;|
elements with EMPTY content are called empty elements.
Examples from HTML 3.2 Final
The allowable content of the HTML element is:
This means that an HTML element must contain exactly one
HEAD followed by exactly
one BODY, in that order.
The allowable content of the
DL definition list element is:
( DT | DD )+
This means that the
DL element contains at least one
DT or DD
element, and maybe more. Don't get confused by the
| symbol here--it does not mean that you have to choose between having
only a DT or DD
The notation means you can choose either one of the elements within the
). But the
+ at the end means you must make this choice at least once, but you can
repeat it as often as you wish. So you can have any number of
DT or DD elements in a
Note that this syntax does not constrain the
sequence or number of DT's (definition terms)
or DD's (definitions).
You could have a
DL element full of a hundred
DT's and just one
The allowable content of the HEAD element is:
( TITLE & ISINDEX ? & BASE ? ) +( SCRIPT | STYLE | META | LINK )
This means that a HEAD element can contain two groupings of possible elements. The first grouping consists of a TITLE element, an optional single ISINDEX, and an optional single BASE element. These can occur in any order.
In the second grouping, you can have
any number of the following elements appear multiple times at various positions within HEAD:
SCRIPT, STYLE, META, or LINK.