Edit online

Linking in DITA Topics

Cross Reference (xref) Dialog Box

The Cross Reference (xref) dialog box is displayed when you insert a Cross Reference or Related Link to Topic (from the Link drop-down menu). It allows you to insert a link to a target resource at the current location within a document (for a Cross Reference link) or in a related links section (for a Related Link to Topic). The target resource can be the location of a file or a key that is already defined in your DITA map structure. Once the target resource has been selected, you can also target specific elements within that resource.

Figure 1. Cross Reference (xref) Dialog Box
Figure 2. Cross Reference (xref) Dialog Box
This dialog box includes the following sections and fields:
Choose the Target Resource Section
Once you click Insert or Insert and close, the configured cross reference is inserted into your document.
Tip:
You can easily insert multiple cross references by keeping the dialog box opened, using the Insert button.

Using Copy/Paste or Drag/Drop Actions to Insert a Cross Reference

Oxygen XML also includes support for inserting cross reference links with simple copy/paste or drag/drop actions (additionally, you can insert them using the Paste as Link or Paste as Link (keyref) actions found in the Paste Special submenu from the contextual menu). The copied/dragged content must be an entire DITA XML element with an @id attribute or a <topicref>. Also, the location in the document where you paste or drop the link must be valid, although as long as the Smart paste and drag and drop option is selected in the Schema-Aware preferences page, if you try to paste it in an invalid location, Oxygen XML will attempt to place it in a valid location, and may prompt you with one or more choices for where to place it.

When the link is inserted, Oxygen XML automatically tries to populate certain attributes based on detected values. The @format, @scope, and @type attributes are populated if their corresponding options are selected in the Inserting Links section of the DITA Topics preferences page. Even if their corresponding options are not selected, the @format and @scope attributes are populated if their detected values are different than the default values.

Note:
For the sake of performance, the @type attribute is never automatically computed in the following cases:
Typically, cross reference links are inserted with an @href attribute, but it is also possible to insert them with a @keyref attribute using the Paste as Link (keyref) contextual menu action or copy/paste or drag/drop actions. For the latter method, follow these steps :
  1. In the DITA Maps Manager view, make sure that the Context combo box points to the correct map that stores the keys.
  2. Make sure the topic that contains the content you want to reference has a key assigned to it. To assign a key, right-click the topic with its parent map opened in the DITA Maps Manager, select Edit Properties, and enter a value in the Keys field.
  3. Copy an entire DITA element that has an ID attribute assigned to it from a topic with an assigned key, or a <topicref> from a DITA map.
  4. Place the cursor at a location, where you want to insert the link.
  5. Select the Paste as Link (keyref) action from the Paste Special submenu from the contextual menu.