<subjectdef>

The <subjectdef> element defines a subject (also known as a controlled value) within a subject scheme. The @keys attribute specified on the <subjectdef> element assigns a key to the subject. A subject with a key can be addressed using a @keyref attribute.

The <subjectdef> also can use a <navtitle> element to supply a label for the subject or the @href attribute to reference a topic that captures the consensus definition for the subject.

As with normal <topicref> processing, when the <subjectdef> element specifies a <navtitle> and refers to a topic, processors should use the actual topic title in place of the <navtitle>. To use the <navtitle> as a subject label, set the @locktitle attribute on the <subjectdef> element to "yes".

Content models

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

Inheritance

- map/topicref subjectScheme/subjectdef

Example

<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: Universal attribute group, Topicref element attributes group, Link relationship attribute group (with a narrowed definition of @href, given below), outputclass, @keys, and @keyref. This element also uses @processing-role, @toc, @collection-type, @linking, and @locktitle from Attributes common to many map elements.
@href
A pointer to the resource represented by the <topicref>. See The href attribute for detailed information on supported values and processing implications. References to DITA content cannot be below the topic level: that is, you cannot reference individual elements inside a topic. References to content other than DITA topics should use the @format attribute to identify the kind of resource being referenced.