What are cross-references in DITA XML?

In DITA XML, cross-references play a fundamental role in creating links between different topics or content within a document. Cross-references, often referred to as xrefs, enable seamless navigation within DITA documentation, providing readers with the ability to jump from one part of the content to another. They are instrumental in connecting related information, which is particularly valuable for large and complex documents.

For example, you can create cross-references in DITA XML to link to definitions, related topics, or examples that provide additional context or information. These links improve the user experience by allowing readers to access relevant content without having to search through the entire document. Cross-references are particularly helpful when you want to avoid duplicating content by referring readers to a single, authoritative source of information.


Let’s consider a DITA XML example of a cross-reference:

<xref href="definitions.dita">See the definition of <term>cross-reference</term></xref>

In this example, we create a cross-reference to the topic “definitions.dita,” specifically pointing to the definition of “cross-reference.” When readers encounter this cross-reference, they can click it to access the definition, making it easier to understand the term within the context of the document.