For example, this ATTLIST declaration declares the
source attribute of the image
element:
<!ATTLIST image source CDATA #REQUIRED>
It says that the image element has an attribute
named source. The value of the
source attribute is character data, and instances
of the image element in the document are required
to provide a value for the source attribute.
A single ATTLIST declaration can declare multiple
attributes for the same element. For example, this
ATTLIST declaration not only declares the
source attribute of the image
element, but also the width,
height, and alt attributes:
<!ATTLIST image source CDATA #REQUIRED
width CDATA #REQUIRED
height CDATA #REQUIRED
alt CDATA #IMPLIED
>
This declaration says the source,
width, and height attributes
are required. However, the alt attribute is
optional and may be omitted from particular image
elements. All four attributes are declared to contain character data,
the most generic attribute type.
This declaration has the same effect and meaning as four separate
ATTLIST declarations, one for each attribute.
Whether to use one ATTLIST declaration per
attribute is a matter of personal preference, but most experienced
DTD designers prefer the multiple-attribute form. Given judicious
application of whitespace, it's no less legible than
the alternative.