Indexes

Indexes

The <indexterm> element inserts index terms into your document. Index terms identify text listed in the index. <indexterm> is loosely based on Docbook's indexterm element.

New in CXML 3.4

<indexterm> now supports @author and @dateTime.

<indexterm> has seven attributes:

AttributeValueDescription
classbookmark
startofrange
endofrange
Specifies a range of text.
idstringThe unique ID of the index term.
startrefstringSpecifies the start of a chunk of text.
pageNumberStylestringSpecifies a character style to apply to the index page number.
statusadded
changed
deleted
Indicates the modification status of the index term.
author NEWstringThe author of the tracked change.
dateTime NEWISO 8601 datetime stringThe date and time of the tracked change (2024-01-09T14:37:00Z).

There are four index levels:

  • <primary>
    • <secondary>
      • <tertiary>
        • <quaternary>

A simple index:

xml
<indexterm>
  <primary>Mercia</primary>
</indexterm>

An index with two index levels:

xml
<indexterm>
  <primary>Mercia</primary>
  <secondary>coconuts</secondary>
</indexterm>

An index with four index levels:

xml
<indexterm>
  <primary>Level one</primary>
  <secondary>Level two</secondary>
  <tertiary>Level three</tertiary>
  <quaternary>Level four</quaternary>
</indexterm>

Using the @pageNumberStyle attribute to specify a character style to apply to the index page number:

xml
<indexterm pageNumberStyle="Index Bold">
  <primary>Mercia</primary>
</indexterm>

You can specify character styles within index levels via the character span (<c>) element:

xml
<indexterm>
  <primary>
    Sketches from
    <c type="Index Italic">Monty Python's Flying Circus</c>
  </primary>
</indexterm>

You can also apply a sort order to any level via the @sortas attribute.

AttributeValueDescription
sortasstringSpecifies a sort order for an index.

Applying alternative sort orders to any level:

xml
<indexterm>
  <primary sortas="Knight">The Black Knight</primary>
</indexterm>

An index term with tracked changes:

xml
<indexterm status="added" author="Terry Gilliam" dateTime="1975-04-05T09:00:00Z">
  <primary>Mercia</primary>
  <secondary>coconuts</secondary>
</indexterm>

See and see also references

The <see> element inserts a see reference into your document; the <seealso> element inserts a see also reference into your document.  <see> and <seealso> references are nested within an <indexterm> element.

Each <indexterm> can contain at most one <see> or <seealso> element, and they are mutually exclusive — you cannot use both in the same <indexterm>.

A see reference:

xml
<indexterm>
  <primary>Connie Booth</primary>
  <see>Witch</see>
</indexterm>

A see also reference:

xml
<indexterm>
  <primary>Monty Python Examines The Life of Brian (promo)</primary>
  <seealso>Monty Python's Life of Brian</seealso>
</indexterm>

Creating an index to a range of text

There are two ways to create an index reference to a range of text: the Microsoft Word approach and the DocBook approach.

Microsoft Word approach

The Microsoft Word approach can be used in workflows where the CXML comes from Typefi Writer. An <indexterm> begins the range; a bookmark (anchor) ends it:

xml
<indexterm class="bookmark" id="film">
 <primary>And Now for Something Completely Different</primary>
</indexterm>
.
.
.
<anchor name="film" />

DocBook approach

The DocBook approach can be used in workflows where the CXML is not coming from Typefi Writer:

xml
<indexterm class="startofrange" id="film" >
 <primary>And Now for Something Completely Different</primary>
</indexterm>
.
.
.
<indexterm class="endofrange" startref="film" />
Last updated: 27 Apr 2026, 18:30:36
Loading navigation...