The Attribute List

The previous qualification of the elements of a DTD deals solely with the number of times the element can appear in the data section. For example, an asterisk after the element name means that it can appear zero or more times, and a plus means it can appear one or more times. While this restricts the number of times the data element can appear, it doesn't restrict the contents of the data element to a data type. This type of restriction can be done by inserting an attribute list into the DTD and associating the attribute with the element.

The notation for an attribute list is

<!ATTLIST ElementName AttributeName Type Default>

where the entries have the following meanings:

ATTLIST— A reserved word that identifies the type ...

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.