Assigning Values to minOccurs and maxOccurs

Recall that in a previous hour you constructed a DTD using the character qualifiers. The object you were describing was an EMAIL object, and the list of elements was as follows:

<!ELEMENT E-MAIL (TO+,FROM,CC*,BCC*,SUBJECT?,BODY?)>

Although the qualification symbols (+, *, ?) do specify the multiplicity of the entries, they're very imprecise. For example, the plus sign (+) simply notes that there can be one or more instances. This imprecision is the primary reason why the minOccurs and maxOccurs parameters were introduced. Used in tandem, they allow you to specify a range of times that an element can appear. The combinations of values have varying interpretations, which are summarized in Table 19.3 ...

Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.