Can individual elements within DITA topics be reused?

Reusing individual elements within DITA topics is a fundamental feature that enhances efficiency and consistency in documentation. DITA XML allows content creators to maximize reuse by referencing or including components, such as text, tables, or images, across multiple topics. This approach streamlines content management, reduces redundancy, and ensures uniformity in information presentation.

Referencing Elements

One way to reuse content is by referencing elements. In DITA, you can employ referencing mechanisms like the <xref> element to link to other elements in different topics. For example, if you have a common glossary term used throughout your documentation, you can reference it in various topics using <xref>. If the glossary term definition changes, it automatically updates everywhere it’s referenced, maintaining consistency.

Including Elements

Another method is including elements. With the <topicref> element in DITA maps, you can include entire topics within other topics. This is particularly valuable for content that should appear in multiple contexts, like disclaimers, copyright notices, or standard procedures. By including topics, you only need to edit the source once to update all instances where it’s used, ensuring accuracy and coherence.

Example:

Here’s an example illustrating content reuse through element inclusion:


<topic id="intro">
  <title>Introduction</title>
  <body>
    <p>This is the introduction to our product.</p>
    <topicref href="common/disclaimer.dita" />
    <topicref href="common/copyright.dita" />
  </body>
</topic>

In this example, the <topicref> elements include the “disclaimer.dita” and “copyright.dita” topics within the “intro” topic. Changes made in the included topics automatically propagate to all instances where they are included, simplifying content management.