Use the cross-reference (<xref>) element to link to a different location within the current topic, or a different topic within the same help system, or to external sources, such as Web pages, or to a location in another topic. The href attribute on the <xref> element provides the location of the target.
Typically it is best to restrict yourself to linking to reference topics where the content of the target is clear from the <xref>'s text, for example API names and their descriptions. With other information types, it may be less clear to the user whether they should follow the link, and often they will, thereby missing important information in following paragraphs. Therefore it is a good idea to use links at the end of the topic, in the <related-links> element, wherever possible, rather than linking from within body content using <xref>. Links at the end of a topic can also be managed from outside the topic, using DITA maps: this allows topics to be quickly integrated into new contexts without breaking links.
Here's an example of a cross-reference to another topic; that topic's title will be used as the link text.
<p>Background information about DITA is provided in the topic titled <xref href="whatsdita.dita#tmmdita"></xref>.</p>
Here's an example of a cross-reference to another topic; the supplied text will be used as the link text
<p><xref href="whatsdita.dita#tmmdita">Background information about DITA</xref> is provided free of charge.</p>
filename.xml#topicid/elementid
#topicid/mysection
#topicid/mylist
Regardless of how deeply the target element is nested, the only important pieces are the ID of the containing topic, and the ID of the target element. IDs of topics in DITA must be unique within a file, but IDs of other elements only need to be unique within the topic. You need to be sure that the topic ID is part of your reference.
http://www.ibm.com/docview.wss?rs=757&context=SSVNX5You need to enter the & in the Href attribute as follows:
<xref href="http://www.ibm.com/docview.wss?rs=757&context=SSVNX5"> Part number SSVNX5</xref>
Doctype | Content model |
---|---|
ditabase, topic, task, reference, concept | ( text data or ph or codeph or synph or filepath or msgph or userinput or systemoutput or b or u or i or tt or sup or sub or uicontrol or menucascade or term or q or boolean or state or keyword or option or parmname or apiname or cmdname or msgnum or varname or wintitle or tm or image or data or data-about or foreign or unknown or desc) (any number) |
map, bookmap | ( text data or ph or term or q or boolean or state or keyword or tm or image or data or data-about or foreign or unknown or desc) (any number) |
- topic/xref
Name | Description | Data Type | Default Value | Required? |
---|---|---|---|---|
href | A hyperlink to an external Web page (URL) or other non-DITA resource,
to another DITA topic in the same file or in another file, or to a specific
element inside a DITA topic. The format attribute identifies the format of
the target. Non-DITA targets use standard URL syntax. DITA content is targetted
as follows:Target elsewhere in the same file: href="#topicID" href="#topicID/elemID Target in a different file: href="filename.dita#topicID" href="fname.dita#topicID/elemID"Elements inside a topic need to have their location scoped by the containing topic's ID. Only the id of the target element and the topic that contains it matter: id's on any other containing elements (for example an id on the <body> element) are not part of the link syntax. If the URL contains an ampersand character, the ampersand symbol (&) should be used to indicate that character |
CDATA | #IMPLIED | No |
type | Describes the target of a cross-reference. See The type attribute for detailed information on supported values and processing implications. | CDATA | #IMPLIED (Processed as if the target were of type "topic", or inherited from an ancestor) | No |
format | The format attribute identifies the format of the resource being cross referenced. See The format attribute for details on supported values. | CDATA | #IMPLIED | No |
scope | The scope attribute identifies the closeness of the relationship
between the current document and the target resource.
|
(local | peer | external | -dita-use-conref-target) | #IMPLIED | No |
%univ-atts; (%select-atts;, %id-atts;, %localization-atts;) | A set of related attributes, described at %univ-atts; | parameter entity | PE not applicable | Not applicable |
%global-atts; (xtrf, xtrc) | A set of related attributes, described at %global-atts; | parameter entity | PE not applicable | Not applicable |
class, outputclass, keyref | Common attributes described in Other common DITA attributes |
Return to main page.
OASIS DITA Version 1.1 Language Specification -- OASIS Standard, 1 August 2007
Copyright © OASIS Open 2005, 2007. All Rights Reserved.