Classifying Attributes: Attribute Types

Attributes can be classified based on the kind of information that they contain. When you define an attribute in XML, you are really defining the attribute type, or the kind of information that the attribute may legally contain to describe an element. Attributes can be one of three different types: strings, tokenized types, or enumerations.

In the interest of compatibility and to create rules for validation (which we will discuss later in this chapter), there are a number of different types of attributes. Attributes consist of predefined datatypes that can be assigned to your attributes when you are working with a Document Type Definition or an XML Schema.

For example, one attribute type is ID, which is ...

Get Special Edition Using XML, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.