Enumerated Attributes

The spec has almost no advertising for one of the most useful things in XML, enumerated attributes. Suppose I have a declaration saying:

<!ATTLIST List Type (numbered|bullets) #REQUIRED>

Then every List element has to have a Type attribute saying whether it's numbered or bulleted; that is to say, the attribute has only two possible values, which are given right there in the declaration. You'll see a lot of this in real-world XML documents; an authoring system can make good use of this; when the author puts in such an element, she gets to pick from a menu of the possible attribute values.

Back-link to spec

Copyright © 1998, Tim Bray. All rights reserved.