Controlled values for attributes

Controlled values for metadata attributes can be defined in a ditamap, and will apply when authoring topics referenced by the ditamap. These controlled values are defined in the subjectScheme element.

DITA 1.2 introduced the ability for the author to specify a set of valid metadata attribute values in the ditamap, and have the authoring tool validate the topics to ensure only listed attribute values were used.

The valid attribute values are stored in a subjectScheme section in the ditamap.

You should store the subjectScheme in a nested ditamap. This is because subjectScheme sections are likely to be re-used, and having separate files makes for easier organisation.

This sample mark-up shows controlled values for the platform attribute of linux, mswin, and zos:
<subjectScheme> 
  <subjectdef keys="os" navtitle="Operating system">
    <subjectdef keys="linux" navtitle="Linux"/>
    <subjectdef keys="mswin" navtitle="Microsoft Windows"/> 
    <subjectdef keys="zos" navtitle="z/OS"/>
  </subjectdef>
  <enumerationdef>
    <attributedef name="platform"/>
    <subjectdef keyref="os"/>
  </enumerationdef>
</subjectScheme>