The <anchorref> element is used to reference an <anchor> element in a map. The contents of an <anchorref> element are rendered both in the original authored location and at the location of the referenced <anchor> element. The referenced <anchor> element may be defined in the current map or another map. When possible, this integration is done when displaying the map with <anchor> to an end user.
This function of the <anchorref> element is similar to that provided by the anchorref attribute of the <map> element. However, instead of attaching an entire map to an anchor point, this element allows the author to attach only the contents of a single map branch. This enables architects to reuse a branch of content without reusing the entire map.
If the rendering platform does not support runtime integration of navigation based on the anchor point, a build system should treat the <anchorref> element similar to a "conref push" instruction by pushing the content to the spot that contains the anchor. Note that many <anchorref> elements may push content to the same point; the order in which items are pushed is left undefined, although the order within a single <anchorref> is preserved.
Metadata cascading must take place in the original authored context, because the branch of content defined with the <anchorref> remains independent from the referenced map. The <anchorref> content does not take on the cascading metadata at the <anchor> location. For example, if the map containing the <anchorref> element sets a local copyright, that copyright cascades to the <anchorref> element and its children; it is retained after the content is rendered at the target <anchor> element.
By default, the content of the <anchorref> element is rendered at both the anchor target and the original location. To prevent the content from being rendered at the location of the <anchorref> element, set toc="no" on the <anchorref> element, and then set toc="yes" on each of its children so that they will not inherit the toc="no" setting.
Doctype | Content model |
---|---|
map (base), bookmap | ( (topicmeta) (optional) then (data or data-about or topicref or anchorref or keydef or mapref or topicgroup or topichead or topicset or topicsetref) (any number) ) |
map (technical content) | ( (topicmeta) (optional) then (data or data-about or topicref or (anchorref or keydef or mapref or topicgroup or topichead or topicset or topicsetref) or (glossref) ) (any number) ) |
classifyMap | ( (topicmeta) (optional) then (data or data-about or topicref or (topicsubject or topicapply) or (anchorref or keydef or mapref or topicgroup or topichead or topicset or topicsetref) ) (any number) ) |
subjectScheme | ( (topicmeta) (optional) then (data or data-about or topicref or (anchorref or keydef or mapref or topicgroup or topichead or topicset or topicsetref) ) (any number) ) |
learningBookmap, learningMap | ( (topicmeta) (optional) then (data or data-about or topicref or anchorref or keydef or mapref or topicgroup or topichead or topicset or topicsetref or learningObject or learningGroup) (any number) ) |
Doctype | Content model |
---|---|
map (base), map (technical content), learningMap | map, topicref, relcolspec, relcell, topichead, topicgroup, anchorref, topicset, topicsetref, keydef |
bookmap, learningBookmap | map, topicref, relcolspec, relcell, frontmatter, backmatter, draftintro, preface, chapter, part, appendix, notices, glossarylist, topichead, topicgroup, anchorref, topicset, topicsetref, keydef |
classifyMap | map, topicref, relcolspec, relcell, topichead, topicgroup, anchorref, topicset, topicsetref, keydef, topicsubject, topicapply, topicCell, subjectCell |
subjectScheme | map, topicref, relcolspec, relcell, subjectScheme, hasNarrower, hasKind, hasPart, hasInstance, hasRelated, subjectdef, subjectHead, relatedSubjects, subjectRole, topichead, topicgroup, anchorref, topicset, topicsetref, keydef |
<topicref href="carPrep.dita"> <topicref href="beforePrep.dita"/> <anchor id="prepDetail"/> <topicref href="afterPrep.dita"/> </topicref> ... <topicref href="astroTasks.dita"> <topicref href="astroOverview.dita"/> <anchorref href="#prepDetail"> <topicref href="astroChecklist.dita"/> <topicref href="otherPreparation.dita"/> </anchorref> <topicref href="astroConclusion.dita"/> </topicref>
<topicref href="carPrep.dita"> <topicref href="beforePrep.dita"/> <anchor id="prepDetail"/> <topicref href="astroChecklist.dita"/> <topicref href="otherPreparation.dita"/> <topicref href="afterPrep.dita"/> </topicref> ... <topicref href="astroTasks.dita"> <topicref href="astroOverview.dita"/> <topicref href="astroChecklist.dita"/> <topicref href="otherPreparation.dita"/> <topicref href="astroConclusion.dita"/> </topicref>
Name | Description | Data Type | Default Value | Required? |
---|---|---|---|---|
navtitle | Specifies the title of the topic as it will appear in the navigation or tables of contents that are generated from the map. Beginning with DITA 1.2, the preferred way to specify the navigation title in a map is with the navtitle element, available inside the topicmeta element. | CDATA | #IMPLIED | No |
href | A pointer to an <anchor> element in this or another DITA map. When rendered, the contents of the <anchorref> element will be copied to the location of the anchor. | CDATA | #IMPLIED | No |
keys | Introduces one or more global identifiers for a resource referenced from a map. See The keys attribute for details on how to use the keys attribute. | NMTOKEN | #IMPLIED | No |
query | This attribute is deprecated. It may be removed in the future. | CDATA | #IMPLIED | No |
copy-to | Use the copy-to attribute on the <topicref>
element to provide a different file name for a particular instance
of the topic in the map (for example, to separate out the different
versions of the topic, rather than combining them on output). The
links and navigation associated with that instance will point to a
copy of the topic with the file name you specified. Use the <linktext> and <shortdesc> in the <topicref>'s <topicmeta> to provide a unique name and short description for the new copy. |
CDATA | #IMPLIED | No |
collection-type | Collection types describe how links relate to each other.
The processing default is "unordered", although no default is specified
in the DTD or Schema.
Usage of the collection-type attribute on <reltable> and <relcolspec> is currently undefined and reserved for future use. |
(unordered | sequence | choice | family | -dita-use-conref-target) | #IMPLIED | No |
processing-role | Describes the processing role of the referenced topic. The
processing default is "normal". If the value is not specified locally,
but is specified on an ancestor, the value will cascade from the
closest ancestor.
|
(normal | resource-only | -dita-use-conref-target) | #IMPLIED | No |
type | Describes the target of a reference. For the anchorref element, this value defaults to "anchor", because the element is expected to point to an anchor element in this or another map. | CDATA | anchor | No |
scope | The scope attribute identifies the closeness of the relationship between the current document and the target resource. See The scope attribute for more information on values. | (local | peer | external | -dita-use-conref-target) | #IMPLIED | No |
locktitle | This attribute makes sure the navtitle element or attribute is used if it is present.
If locktitle isn't set
to "yes", the navtitle is ignored and text is retrieved from the
target.
|
(yes | no | -dita-use-conref-target) | #IMPLIED | No |
format | The format attribute identifies the format of the resource being referenced. For the anchorref element, this value defaults to "ditamap", because the element references a point in a map. | CDATA | ditamap | No |
linking | Defines some specific linking characteristics of a topic's
current location in the map. If the value is not specified locally,
but is specified on an ancestor, the value will cascade from the
closest ancestor.
|
(targetonly | sourceonly | normal | none | -dita-use-conref-target) | #IMPLIED | No |
toc | Specifies whether a topic appears in the table of contents (TOC). If the value is not specified locally, but is specified on an ancestor, the value will cascade from the closest ancestor. | (yes | no | -dita-use-conref-target) | #IMPLIED | No |
Specifies whether the topic should be included in a
print-specific rendition, such as PDF. The processing default is "yes".
If the value is not specified locally,
but is specified on an ancestor, the value will cascade from the
closest ancestor.
|
(yes | no | printonly | -dita-use-conref-target) | #IMPLIED | No | |
search | Describes whether the target is available for searching. If the value is not specified locally,
but is specified on an ancestor, the value will cascade from the
closest ancestor.
|
(yes | no | -dita-use-conref-target) | #IMPLIED | No |
chunk | When a set of topics
is transformed using a map, the chunk attribute allows multi-topic
documents to be broken into smaller files and multiple individual
topics to be combined into larger combined documents. For a detailed description of the chunk attribute and its usage, see Chunking in the DITA Architectural Specification. |
CDATA | #IMPLIED | No |
keyref | Keyref provides a redirectable reference based on a key defined within a map. See The keyref attribute for information on using this attribute. | CDATA | #IMPLIED | No |
univ-atts attribute group (includes select-atts, id-atts, and localization-atts groups) | A set of related attributes, described in univ-atts attribute group | |||
global-atts attribute group (xtrf, xtrc) | A set of related attributes, described in global-atts attribute group | |||
class, outputclass | Common attributes described in Other common DITA attributes |
Return to main page.
DITA v1.2 CD 03
Copyright © OASIS Open 2005, 2010. All Rights Reserved.