<keydef>

The <keydef> element is a convenience element that is used to define keys without any of the other effects that occur when using a <topicref> element: no content is included in output, no title is included in the table of contents, and no linking or other relationships are defined. The <keydef> element is not the only way to define keys; its purpose is to simplify the process by defaulting several attributes to achieve the described behaviors.

Content models

See appendix for information about this element in OASIS document type shells.

Inheritance

+ map/topicref mapgroup-d/keydef

Example

The following example defines keys that can be used to refer to the indicated topics. These keys can be used within the map, from any topic in this map, or in any context where this map is imported. Note that the @processing-role attribute defaults to "resource-only", which ensures that specified topics will not be rendered in a print document or in a navigation TOC based on this definition in the map. In addition, it means that links will not be generated to or from the <keydef> elements.

<map>
  <title>Defining bird keys</title>
  <keydef keys="darwinfinch galapagosfinch"  href="galapagosfinch.dita"/>
  <keydef keys="goldfinch"  href="about-goldfinches.dita"/>
  <keydef keys="puffin"     href="about-puffins.dita"/>
  <keydef keys="loon diver" href="common-loon.dita"/>
</map>

Attributes

The following attributes are available on this element: Universal attribute group, Link relationship attribute group (with a narrowed definition of @href, given below), Attributes common to many map elements (with a narrowed definition of @processing-role, given below), Topicref element attributes group, @outputclass, @keyref, and the attributes defined below.

@keys (REQUIRED)
On this element the @keys attribute is required, because the purpose of the element is to define a key. Otherwise, the attribute is the same as described in The @keys attribute.
@href
A pointer to the resource represented by the <topicref>. See The @href attribute for detailed information on supported values and processing implications. References to DITA content cannot be below the topic level: that is, you cannot reference individual elements inside a topic. References to content other than DITA topics should use the @format attribute to identify the kind of resource being referenced.
@processing-role
For this element, the default value for @processing-role is "resource-only". Otherwise, the definition matches the one found in Attributes common to many map elements.

Was this helpful?