Inline links can be created DITA topics using the <xref> element. The
destination of the link can be expressed directly by using the @href
attribute and the target can be another topic or a specific element within the other topic,
another location within the same topic, a file, or a web link. You can also create direct
related links to topics, files, or websites in a DITA topic using the
<related-links> element.
The destination of the link can also be expressed indirectly by using keys to create either inline links or related
links (with the @keyref attribute). By using keys, you avoid creating
a direct dependency between topics. This makes links easier to manage and can make it easier
to reuse topics in various publications. It can also be helpful in verifying the
completeness of a publication, by ensuring that a publication map provides a key definition
for every key reference used in the content.
<xref> element and specifies the key to
link to.<topicref> element
that points to a topic. This allows you to assign a particular key to one topic in one map
and to another topic in another map. When a topic that links to that key is used in each of
these maps, the links work correctly in both maps.To insert a link in Author mode, use the actions available in the
Link
drop-down menu from the toolbar (or the
Link submenu in the contextual menu or DITA menu).
You can choose between the following types of inline links:
<xref> - Used to link to other topics or another location within
the same topic and points to the target using the @href or
@keyref attribute.<fragref> - A logical reference to a fragment element within a
syntax diagram and points to the target using the @href or
@keyref attribute.<xref> element with either an
@href attribute or a @keyref attribute. If you
select Location for the target, the link is expressed in an
@href attribute. If you select Key for the
target, keys will be used to express the link in a @keyref attribute.
You can select a key from the drop-down list or click the
Choose Key Reference
button to use the Choose
Key dialog box.<xref> element with either an @href attribute or a
@keyref attribute. If you select URL for the
target resource, the link is expressed in an @href attribute. If you
select Key for the target, keys will be used to express the
link in a @keyref attribute. You can select a key from the drop-down
list or click the
Choose Key Reference button to use the Choose Key dialog
box.<link> element inside a related-links element. <title>, <shortdesc>,
<keyword>, and <indexterm> elements.<link> element
inside a related-links element. If you select
Location for the target, the link is expressed in an
@href attribute. If you select Key for the
target, keys will be used to express the link in a @keyref attribute.
You can select a key from the drop-down list or click the
Choose Key Reference
button to use the Choose
Key dialog box.<link>
element inside a related-links element. If you select
URL for the target resource, the link is expressed in an
@href attribute. If you select Key for the
target, keys will be used to express the link in a @keyref attribute.
You can select a key from the drop-down list or click the
Choose Key Reference
button to use the Choose
Key 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.
@href attribute.@keyref attribute. You can use the
Choose Key Reference button to open
the Choose Key dialog box that allows you to select one
from a list of all the keys that are gathered from the root map (you can also
select one from the drop-down list in the Key
field).
@keys attribute).<navtitle> or
<keyword> element have that value listed in
this column.@href attribute have that href value listed in this
column.This section can be used to target a specific element inside the target resource.
Oxygen XML Author Eclipse plugin 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 Author Eclipse plugin 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 Author Eclipse plugin 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.
@type attribute is never automatically
computed in the following cases:<topicref> elements
do not have the @type attribute defined.@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 :<topicref> from a DITA map.
Paste
Special submenu from the contextual menu.