Edit online

Content Reference Ranges

Read time: 1 minute(s)

Instead of reusing a series of consecutive elements (for example steps, list items) one by one you can reuse an entire range of sibling elements. For this to work, both the initial and the final elements need to have IDs defined on them.

Small example of content key reference with ranges

Reusable steps from task reusable_steps.dita:

  <steps>
      <step id="washing">
        <cmd>Wash the vegetables thoroughly.</cmd>
      </step>
      …..
      <step id="peeling">
        <cmd>Pass the peeler gently over the vegetable.</cmd>
      </step>
    </steps>

Key definition in DITA Map:

 <keydef keys="reusable_steps" href="reusable_steps.dita"/>

Content key reference range:

    <steps>
      <step conkeyref="reusable_steps/washing" conrefend="default.dita#default/peeling">
        <cmd/>
      </step>
    </steps>

The usual dialog from Oxygen used to insert reusable content can also be used to select the range of elements to insert: https://www.oxygenxml.com/doc/ug-editor/#topics/insert-dita-content-reference.html.