DITA ID Management

In DITA, the uniqueness of ID attributes within a specific scope is essential for making references.

According to XML standard, ID attributes are declared as attributes with type ID in a Schema or DTD. In this case, Schema validation provides the uniqueness of ID values within the scope of the whole document.

However, when it comes to DITA, the way an ID is validated depends on the type of the element:
  1. Topic elements

    Topic elements include topic, concept, task, and other specialized topics.

    The ID attribute of a topic element must be unique within the scope of the whole document. This is reflected in the format of references to topic elements as illustrated below:

    For example, a concept with ID "concept" and its child concept with ID "concept-1" will be referenced like this:
    • href="document.xml#concept"

    • href="document.xml#concept-1"

    IDs of topic elements are declared as attributes with type ID in a Schema or DTD.

  2. Non-topic elements

    Schema validation of IDs can't be applied to all types of elements. Schema validates IDs of DITA topic elements only, while IDs of DITA non-topic elements are validated another way.

    Non-topic elements are child elements of topic elements.

    DITA ID is the ID attribute of a non-topic element.

    DITA IDs of non-topic elements must be unique within the following scopes:

    1. In topic-based documents

      In a topic-based document, the DITA ID of a non-topic element must be unique within the scope of its parent topic.

    2. In map-based documents

      In a map-based document, the DITA ID of a non-topic element must be unique within the scope of its parent map.

    Thus, DITA ID must be unique within the scope of its nearest parent topic or map. This is reflected in the format of references to non-topic elements as illustrated below:

    For example, two elements from different scopes (e.g. from a task and a concept of the same Composite document) can have identical IDs "legal notice". They will be referenced like this:
    • href="document.xml#concept/legal-notice"

    • href="document.xml#task/legal-notice"

    The uniqueness of DITA IDs of non-topic elements within the scope of the parent topic or map can't be provided by means of Schema and DITA IDs are specially treated in Serna. For the maintenance and validation of DITA ID uniqueness, the rules are specified in Serna document template files.

    When you work with DITA documents, Serna maintains the uniqueness of DITA elements' IDs and reports duplicate DITA IDs.

Related concepts
References in DITA Documents
DITA Custom Content
Images in DITA Documents
Deprecated Content in DITA Documents