DITA Resource Center

<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 both an <attributedef> and an <elementdef> element, the enumeration applies to the specified attribute only on the specified element. The enumeration does not apply to the attribute on other elements. For example, when the <enumerationdef> element contains both <attributedef name="value"/> and <elementdef name="lomDifficulty"/>, only the @value attribute on the <lomDifficulty> element is limited to the specified enumeration. The possible values for the @value attribute on other elements are not affected.

When the <enumerationdef> element contain an <attributedef> element but no <elementdef> element, the controlled set of values bound to the attribute apply to all elements. For example, when <enumerationdef> contains only <attributedef name="value"/>, the @value attribute is limited to the specified enumeration for all elements.

When the <enumerationdef> element is empty, 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. An attribute that is defined as CDATA can take multiple values, while an attribute defined as NMTOKEN can take only one.

Content models

See appendix for information about this element in OASIS document type shells.

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

The following attributes are available on this element: ID attribute group, @status and @base from Metadata attribute group, @outputclass, Debug attribute group, and @class (Not for use by authors).

Was this page helpful?