索引的生成取决于文本中插入的标记。
这些标记将随后由外部工具处理,并生成索引。其中一个工具的例子是collateindex.pl脚本(参见B.6.2 节)。关于用于生成这些索引的过程的详细信息,请参见B.6.2 节。
索引具有嵌套级别。索引的标记是通过代码示例 D-3完成的。
示例 D-3. 用于生成索引的代码
| <indexterm> <primary>Main level</primary> <secondary>Second level</secondary> <tertiary>Third level</tertiary> </indexterm> | 
可以使用attributezone.
来引用文档的章节、节和其他部分。zone
| <section id="encoding-index"> <title>Encoding Indexes</title> <indexterm zone="encoding-index"> <primary>edition</primary> <secondary>index</secondary> </indexterm> <para> The generation of indexes depend on the inserted markups on the text. </para> | 
示例 D-4. 属性的使用zone示例 D-4 具有用于生成此版本索引条目的代码。事实上,由于使用了属性
,索引语句可以位于文档中的任何位置,甚至位于单独的文件中。
然而,为了方便维护,索引的条目都放在了它所指的文本之后。示例 D-5. 值的用法startofrange和endofrange在属性
| 
    <para>Typing the text normally
    sometimes there's the need of
   <indexterm class="startofrange"
   id="example-band-index">
      <primary>examples</primary> <secondary>index</secondary>
   </indexterm> mark large amounts of
   text.</para>
   <para>Keep inserting the paragraphs
   normally.</para>
   <para>Until the end of the section
   intended to be indexed.  <indexterm
   startref="example-band-index" class="endofrange">.
   </para> |