<xref>
A cross reference is an inline link. A cross reference can link to a different location within the current topic, another topic, a specific location in another topic, or an external resource such as a PDF or web page.
Attributes
The following attributes are available on this element: link-relationship attributes, universal
attributes, and @keyref
.
Examples
This section contains examples of how the <xref>
element
can be used.
The following code sample shows a cross reference to another topic. Link text is not provided. Processor typically use the topic title as the link text.
<p>Background information about DITA is provided in
<xref href="overview-of-dita.dita"/>.</p>
The same cross reference could be created using @keyref
instead of @href
. Using @keyref
allows the link to be redirected to different resources when the
topic is used in different contexts.
The following code sample shows a cross reference that specifies link text:
<p>While this set of tutorials gives several simple examples of
<xref keyref="markup-examples">common DITA features</xref>, a comprehensive
list of DITA features is available in the DITA specification
<xref keyref="dita-conformance">conformance clause</xref>.</p>
The following code sample shows a cross reference to a web page:
<xref href="https://www.example.com/docview.wss?rs=757"
scope="external" format="html">Part number SSVNX5/>