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:
| Attribute | Value | Description |
|---|---|---|
| class | bookmark startofrange endofrange | Specifies a range of text. |
| id | string | The unique ID of the index term. |
| startref | string | Specifies the start of a chunk of text. |
| pageNumberStyle | string | Specifies a character style to apply to the index page number. |
| status | added changed deleted | Indicates the modification status of the index term. |
| author NEW | string | The author of the tracked change. |
| dateTime NEW | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
There are four index levels:
<primary><secondary><tertiary><quaternary>
A simple index:
<indexterm>
<primary>Mercia</primary>
</indexterm>An index with two index levels:
<indexterm>
<primary>Mercia</primary>
<secondary>coconuts</secondary>
</indexterm>An index with four index levels:
<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:
<indexterm pageNumberStyle="Index Bold">
<primary>Mercia</primary>
</indexterm>You can specify character styles within index levels via the character span (<c>) element:
<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.
| Attribute | Value | Description |
|---|---|---|
| sortas | string | Specifies a sort order for an index. |
Applying alternative sort orders to any level:
<indexterm>
<primary sortas="Knight">The Black Knight</primary>
</indexterm>An index term with tracked changes:
<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:
<indexterm>
<primary>Connie Booth</primary>
<see>Witch</see>
</indexterm>A see also reference:
<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:
<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:
<indexterm class="startofrange" id="film" >
<primary>And Now for Something Completely Different</primary>
</indexterm>
.
.
.
<indexterm class="endofrange" startref="film" />