<indexterm>
An <indexterm>
element contains content that is used to produce an
index entry in a generated index. Nested <indexterm>
elements create
multi-level indexes.
Rendering expectations
The content of @indexterm
entries is not rendered in the flow of body text;
it is rendered only as part of a generated index.
Attributes
The following attributes are available on this element: universal
attributes, @keyref
, and the
attributes defined below.
Examples
This section contains examples of how <indexterm>
elements can be
used.
When index entries are placed in the body of a topic, they serve as point references to their location in the topic.
In the following code sample, the <indexterm>
element provides a
point reference to the beginning of the paragraph.
<p><indexterm>databases</indexterm>Databases are used to ...</p>
When index entries are located within the <prolog>
element in a
topic or the <topicmeta>
element in a DITA map, they serve as point
references to the start of the topic title.
In the following code sample, the <indexterm>
element provides a
reference to the topic as a whole; the generated index entry is associated with the start
of the <title>
element.
<topic id="about-databases">
<title>About databases</title>
<prolog>
<metadata>
<keywords>
<indexterm>databases</indexterm>
</keywords>
</metadata>
</prolog>
<body>
<!-- content... -->
</body>
</topic>
The effect is the same as if the <indexterm>
element had been
located in the map:
<map>
<topicref href="aboutdatabases.dita">
<topicmeta>
<keywords>
<indexterm>databases</indexterm>
</keywords>
</topicmeta>
</topicref>
<!-- ... -->
</map>
A simple index range will look something like this:
<indexterm start="cheese">cheese</indexterm>
<!-- ... additional content -->
<indexterm end="cheese"/>
This markup will generate a top-level index term for "cheese" that covers a series of pages, such as:
cheese 18-24
Specifying a range for nested terms is similar. In this sample, the range is specified for the tertiary index entry "pecorino":
<indexterm>cheese
<indexterm>sheeps milk
<indexterm start="level-3-pecorino">pecorino</indexterm>
</indexterm>
</indexterm>
<!-- ... additional content ... -->
<indexterm end="level-3-pecorino"/>