###### 3.1.5.1.8 enumerationdef

The <enumerationdef> element identifies one attribute and one or more categories that contain the controlled values for the enumeration. The type attribute has a default value of keys.

When the <enumerationdef> element contains an <elementdef> element, the defined enumeration applies to that attribute only on the element specified by <elementdef>. The enumeration does not apply to the same attribute on other elements. For example, when the element contains both <elementdef name="lomDifficulty"/> and <attributedef name="value"/>, this means that the only the value attribute on the <lomDifficulty> element is limited to the specified enumeration. The value attribute on other elements is not affected.

When the <enumerationdef> element does not contain an <elementdef> element, the attribute specified is limited to the enumeration on all elements. For example, when <enumerationdef> contains <attributedef name="value"/> but does not contain <elementdef>, the value attribute is limited to the specified enumeration for all elements.

An enumeration can specify an empty category without children. In this case, no value is valid for the attribute.

Whether an attribute takes a single value or multiple values from the enumeration is part of the structural definition of the element controlled by the DTD or XML Schema. That is, an attribute which is defined as CDATA may take multiple values, while an attribute defined as NMTOKEN may take only one.

###### Contains

Doctype | Content model
subjectScheme | ( (elementdef) (optional) then (attributedef) then (subjectdef) (one or more) then (defaultSubject) (optional) then (data or data-about) (any number) )

###### Contained by

Doctype | Content model
subjectScheme | subjectScheme

###### Inheritance

- map/topicref subjectScheme/enumerationdef

###### Example

In this example, enumerations are specified for the platform and otherprops attributes. Note that the enumeration identifies a category of values; the values within the category are valid, while the category itself is not a valid value. For example, in the code sample here, the platform attribute is associated with the enumeration for the category "os"; all values within the "os" category are thus valid on the platform attribute, while the value "os" itself is not.

    <subjectScheme>
      <!-- Pull in a scheme that defines unix OS values -->
      <schemeref href="unixOS.ditamap"/>
      <!-- Define new OS values that are merged with those in the unixOS scheme -->
      <subjectdef keys="os">
        <subjectdef keys="linux"/>
        <subjectdef keys="mswin"/>
        <subjectdef keys="zos"/>
      </subjectdef>
      <!-- Define application values -->
      <subjectdef keys="app" navtitle="Applications">
        <subjectdef keys="apacheserv" href="subject/apache.dita"/>
        <subjectdef keys="mysql"      href="subject/sql.dita"/>
      </subjectdef>

      <!-- Define an enumeration of the platform attribute, equal to
           each value in the OS subject. This makes the following values
           valid for the platform attribute: linux, mswin, zos -->
      <enumerationdef>
        <attributedef name="platform"/>
        <subjectdef keyref="os"/>
      </enumerationdef>
      <!-- Define an enumeration of the otherprops attribute, equal to
           each value in the application subjects.
           This makes the following values valid for the otherprops attribute:
           apacheserv, mysql -->
      <enumerationdef>
        <attributedef name="otherprops"/>
        <subjectdef keyref="app"/>
      </enumerationdef>
    </subjectScheme>

###### Attributes

Name | Description | Data Type | Default Value | Required?
id-atts attribute group (id, conref, conrefend, conaction, conkeyref) | A set of related attributes, described in 3.4.1.4 id-atts attribute group |  |  |
status | The modification status of the current element. | new | changed | deleted | unchanged | -dita-use-​conref-​target | #IMPLIED | No
base | A generic attribute that has no specific purpose. It is intended to act as a base for specialized attributes that have a simple value syntax like the conditional processing attributes (one or more alphanumeric values separated by whitespace), but is not itself a filtering or flagging attribute. | CDATA | #IMPLIED | No
global-atts attribute group (xtrf, xtrc) | A set of related attributes, described in 3.4.1.2 global-atts attribute group |  |  |
class, outputclass | Common attributes described in 3.4.1.9 Other common DITA attributes |  |  |

Previous Topic: 3.1.5.1.7 hasRelated

Next Topic: 3.1.5.1.9 elementdef

Parent Topic: 3.1.5.1 Subject scheme maps

Sibling Topics:

3.1.5.1.1 subjectScheme

3.1.5.1.2 schemeref

3.1.5.1.3 hasInstance

3.1.5.1.4 hasKind

3.1.5.1.5 hasNarrower

3.1.5.1.6 hasPart

3.1.5.1.7 hasRelated

3.1.5.1.9 elementdef

3.1.5.1.10 attributedef

3.1.5.1.11 defaultSubject

3.1.5.1.12 subjectHead

3.1.5.1.13 subjectHeadMeta

3.1.5.1.14 subjectdef

3.1.5.1.15 relatedSubjects

3.1.5.1.16 subjectRelTable

3.1.5.1.17 subjectRelHeader

3.1.5.1.18 subjectRel

3.1.5.1.19 subjectRole