
Document Type Definitions (DTD) • 119
The keyword ATTLIST describes the attribute(s) for an element.
Figure 3.23 shows an XML document containing an inline DTD. We can see that the element contains
an attribute.
<?xml version =”1.0” ?>
<!DOCTYPE email [
<!ELEMENT email message) >
<!ELEMENT message #PCDATA)>
<!ATTLIST message from CDATA #REQUIRED>
<!ATTLIST message to CDATA #REQUIRED>
<!ATTLIST message subject CDATA #REQUIRED>
]>
<email>
<message from = “jui” to = “harshu” subject = “where are you?”>
It is time to have food!
</message>
</email>
Figure 3.23 Declaring attributes in a DTD
We can see that the message element has three attributes: ...