Are there reserved attribute names in DITA?

In DITA XML, there are reserved attribute names that serve specific purposes and should not be used for custom attributes to avoid potential conflicts and ensure consistency in processing. These reserved attribute names are designed to control various aspects of element behavior, linking, and conditional processing. It’s essential to be aware of these reserved attributes and their intended use within the DITA framework.

Reserved Attribute Names

DITA XML defines several reserved attribute names, including “keyref,” “conref,” “conkeyref,” and “id.” These attributes are used to manage relationships between DITA elements and control conditional processing. For example, the “keyref” attribute is used to establish relationships between elements, while “conref” and “conkeyref” are used for conditional content inclusion based on specified conditions. The “id” attribute provides a unique identifier for an element within a DITA document.


Here’s an example demonstrating the use of the reserved “keyref” attribute:

<topic id="topic1">
    <p>This is an introductory topic.</p>

<topic id="topic2">
  <title>Additional Information</title>
    <p>This topic contains additional details.</p>
    <conbody conref="topic1#topic1"/>

In this example, the “keyref” attribute is used to establish a relationship between “topic2” and “topic1,” allowing content reuse from “topic1” within “topic2.” This illustrates how reserved attributes are used to control linking and conditional processing in DITA XML.