Working with Attributes

As you learned earlier in the chapter, attributes are used to specify additional information about an element. Within an element, attributes are used to form a name/value pair that somehow describes a particular property of the element. Attributes are declared in a DTD using attribute list declarations, which take the following form:

<!ATTLIST ElementName
						AttrName
						AttrType
						Default>

As you can see, an attribute has both a name (AttrName) and a type (AttrType), as well as a default value (Default). The default value for an attribute refers to either a value or a symbol that indicates the usage of the attribute. There are four different types of default values you can specify for an attribute in Default:

  • #REQUIRED— The ...

Get XML Unleashed 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.