Name
Attribute List Declaration
Synopsis
<!ATTLIST
element_name
[attribute_name attribute_type default_decl]
*>
In a valid XML document, it is necessary to declare the attribute names, types, and default values that are used with each element type.
The attribute name must obey the rules for XML names, and no duplicate attribute names may exist within a single declaration.
Attributes are declared as having a specific type. Depending on the declared type, a validating XML parser will constrain the values that appear in instances of those attributes within a document. The following table lists the various attribute types and their meanings:
Attribute type | Meaning |
| Simple character data. |
| A unique |
IDREF, IDREFS | A single reference to an element |
ENTITY, ENTITIES | A single reference to a declared unparsed
external entity ( |
NMTOKEN, NMTOKENS | A single name token value ( |
Get XML in a Nutshell, 3rd Edition 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.