HTML and CSS Reference
In-Depth Information
In the case of traditional HTML, which is defined using SGML, we see a different syntax
that defines
<!ELEMENT name minimization content_model >
In the traditional DTD, we see
<!ELEMENT BR - O EMPTY>
Here, tag minimization is declared by two parameters that indicate the start and end
tags. These parameters may take one of two values. A hyphen indicates the tag is required.
An uppercase O indicates it may be omitted. The combination of O for the end tag and the
content model EMPTY means the end tag is forbidden. Thus, under traditional HTML a <br>
tag requires a start tag but not an end tag. Because a <br> tag does not contain content, its
content model is defined by the keyword EMPTY , just as it did in the XHTML specification.
N OTE Under standard HTML, the elements in the DTD are actually uppercase. While older HTML
was almost always in uppercase, newer HTML efforts are nearly always in lowercase, given the
influence of XHTML; thus we will use the common lowercase forms when discussing tags in this
appendix, though the related syntax will show uppercase.
Most HTML and XHTML elements enclose content. If a content model is declared, it is
enclosed within parentheses and known as a model group. The HTML 4.0 declaration for a
selection list option gives an example:
<!ELEMENT OPTION - O (#PCDATA)*>
The XHTML equivalent is almost identical, save the casing of the element itself and the
lack of the minimization information.
<!ELEMENT option (#PCDATA)>
Note in both cases the content model group contains the keyword #PCDATA . This stands for
parsed character data —character content that contains no element markup but that may
contain entity symbols for special characters. Keywords such as #PCDATA and CDATA are
discussed in the section “SGML and XML Keywords.”
Occurrence Indicators
In a previous example, note the asterisk appended to the model group. This is an occurrence
indicator —a special symbol that qualifies the element type or model group to which it is
appended, indicating how many times it may occur. There are three occurrence indicators:
? Means optional and at most one occurrence (zero or one occurrence)
* Means optional and any number of occurrences (zero or more occurrences)
+ Means at least one occurrence required (one or more occurrences)
Search WWH ::




Custom Search