Element IDs

Most DITA elements have an id attribute, which is used to uniquely identify the element when the element is re-used. In most cases, id attributes are optional, but an exception is the topic's root element, where it is mandatory.

The id attribute of elements must be unique in the context of a file, but ideally, should also be unique in the context of a publication. Many authoring tools automatically generate unique identifiers for elements using a GUID. The id attribute is used in referencing, such as cross-references (xref) and content references (conref).

ID attributes in DITA must start with an alphabetical character, and cannot start with a numerical character. The XML rules for ID attributes require them to start with a letter or an underscore (or a colon).

ID attributes are mandatory for the topic root elements (topic, concept, task and reference), but are optional for most other elements.

If you are going to exchange DITA documents with others, you must ensure that the interchanged document set has unique identifiers; this may require the establishment of naming conventions to avoid identifier conflicts.

Example of a generated (GUID) id attribute:
<concept id="concept_F544B5D5759746C2A199A99518FA1EAE">
Examples of manually created id attributes:
<concept id="c9119">
<cite id="cite_chicago_manual_of_style_ed4">