HTML.and.XHTML.The.Complete.Reference.4th.Edition [Electronic resources]

Thomas Powell

نسخه متنی -صفحه : 252/ 214
نمايش فراداده

Occurrence Indicators

In the previous example, also 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)

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:

<!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)+>