| 1 | <refentry id="indexterm.element"> |
| 2 | <?dbhtml filename="indexterm.html"?> |
| 3 | <refentryinfo> |
| 4 | <pubdate>$Date$</pubdate> |
| 5 | <releaseinfo>$Revision$</releaseinfo> |
| 6 | </refentryinfo> |
| 7 | |
| 8 | <refmeta> |
| 9 | <indexterm><primary>elements</primary> |
| 10 | <secondary>indexterm</secondary></indexterm> |
| 11 | <refentrytitle>indexterm</refentrytitle> |
| 12 | <refmiscinfo>Element</refmiscinfo> |
| 13 | </refmeta> |
| 14 | <refnamediv> |
| 15 | <refname>indexterm</refname> |
| 16 | <refpurpose>&indexterm.purpose;</refpurpose> |
| 17 | </refnamediv> |
| 18 | |
| 19 | &indexterm.synopsis.gen; |
| 20 | <refsect1 condition='ref.description'><title>Description</title> |
| 21 | |
| 22 | <para> |
| 23 | <sgmltag>IndexTerm</sgmltag>s identify text that is to be placed in the |
| 24 | index. In the simplest case, the placement of the |
| 25 | <sgmltag>IndexTerm</sgmltag> in the document identifies the location of |
| 26 | the term in the text. In other words, the <sgmltag>IndexTerm</sgmltag> |
| 27 | is placed in the flow of the document at the point where the |
| 28 | <sgmltag>IndexEntry</sgmltag> in the <sgmltag>Index</sgmltag> should point. In |
| 29 | other cases, attributes on <sgmltag>IndexTerm</sgmltag> are used to |
| 30 | identify the location of the term in the text. |
| 31 | </para> |
| 32 | |
| 33 | <para> |
| 34 | <sgmltag>IndexTerm</sgmltag>s mark either a single point in the document |
| 35 | or a range. A single point is marked with an <sgmltag>IndexTerm</sgmltag> |
| 36 | placed in the text at the point of reference. |
| 37 | There are two ways to identify a range of text: |
| 38 | |
| 39 | <itemizedlist> |
| 40 | <listitem> |
| 41 | <para> |
| 42 | Place an <sgmltag>IndexTerm</sgmltag> at the beginning of the range with |
| 43 | <sgmltag class='attribute'>Class</sgmltag> set to <literal>StartOfRange</literal> and |
| 44 | give this term an <sgmltag class='attribute'>ID</sgmltag>. |
| 45 | Place another <sgmltag>IndexTerm</sgmltag> at the end of the range with |
| 46 | <sgmltag class='attribute'>StartRef</sgmltag> pointing to the |
| 47 | <sgmltag class='attribute'>ID</sgmltag> of the starting <sgmltag>IndexTerm</sgmltag>. |
| 48 | This second <sgmltag>IndexTerm</sgmltag> must be empty. |
| 49 | </para> |
| 50 | <para> |
| 51 | The advantage of this method is that the range can span unbalanced element |
| 52 | boundaries. |
| 53 | </para> |
| 54 | </listitem> |
| 55 | <listitem> |
| 56 | <para> |
| 57 | Place the <sgmltag>IndexTerm</sgmltag> anywhere you like and point to the |
| 58 | element that contains the range of text you wish to index with the |
| 59 | <sgmltag class='attribute'>Zone</sgmltag> attribute on the <sgmltag>IndexTerm</sgmltag>. |
| 60 | Note that <sgmltag class='attribute'>Zone</sgmltag> is defined as |
| 61 | <literal>IDREFS</literal> so a single <sgmltag>IndexTerm</sgmltag> can point to |
| 62 | multiple ranges. |
| 63 | </para> |
| 64 | <para> |
| 65 | The advantage of this method is that <sgmltag>IndexTerm</sgmltag>s can be |
| 66 | collected together or even stored totally outside the flow of the |
| 67 | document (in the meta for example). |
| 68 | </para> |
| 69 | </listitem> |
| 70 | </itemizedlist> |
| 71 | </para> |
| 72 | |
| 73 | <refsect2><title>Processing expectations</title> |
| 74 | <para> |
| 75 | <sgmltag>IndexTerm</sgmltag>s are suppressed in the primary text flow, although they |
| 76 | contribute to the population of an index and serve as anchors for |
| 77 | cross references. |
| 78 | Under no |
| 79 | circumstances is the actual content of <sgmltag>IndexTerm</sgmltag> |
| 80 | rendered in the primary flow. |
| 81 | </para> |
| 82 | |
| 83 | <para> |
| 84 | It is possible to construct index terms that are difficult to parse at |
| 85 | best and totally illogical at worst. Consider the following: |
| 86 | |
| 87 | <screen> |
| 88 | <![CDATA[ |
| 89 | <indexterm class='startofrange' zone="id1 id2">...</indexterm> |
| 90 | ]]> |
| 91 | </screen> |
| 92 | </para> |
| 93 | |
| 94 | <para> |
| 95 | There is no way that this can fit into the semantics of an |
| 96 | <sgmltag>IndexTerm</sgmltag>. Although it claims to be the start of a range, |
| 97 | it does not have an |
| 98 | <sgmltag class='attribute'>ID</sgmltag> for the end-of-range |
| 99 | <sgmltag>IndexTerm</sgmltag> to point back to. |
| 100 | In addition, it includes zoned terms, and mixing the two |
| 101 | different methods for indicating a range in the same <sgmltag>IndexTerm</sgmltag> |
| 102 | is probably a bad idea. |
| 103 | </para> |
| 104 | </refsect2> |
| 105 | |
| 106 | |
| 107 | &indexterm.parents.gen; |
| 108 | &indexterm.children.gen; |
| 109 | </refsect1> |
| 110 | <refsect1 condition='ref.elem.attrdesc'><title>Attributes</title> |
| 111 | <variablelist> |
| 112 | <varlistentry><term>class</term> |
| 113 | <listitem> |
| 114 | <para> |
| 115 | <sgmltag class="attribute">Class</sgmltag> identifies the type of |
| 116 | <sgmltag>IndexTerm</sgmltag>. If <sgmltag class="attribute">StartRef</sgmltag> is supplied, |
| 117 | the default for <sgmltag class="attribute">Class</sgmltag> is <literal>EndOfRange</literal>, |
| 118 | otherwise it is <literal>Singular</literal>. |
| 119 | </para> |
| 120 | </listitem> |
| 121 | </varlistentry> |
| 122 | <varlistentry><term>pagenum</term> |
| 123 | <listitem> |
| 124 | <para> |
| 125 | <sgmltag class="attribute">PageNum</sgmltag> indicates the page on which this |
| 126 | index term occurs in some version of the printed document. |
| 127 | </para> |
| 128 | </listitem> |
| 129 | </varlistentry> |
| 130 | <varlistentry><term>scope</term> |
| 131 | <listitem> |
| 132 | <para> |
| 133 | <sgmltag class="attribute">Scope</sgmltag> identifies in which indexes the |
| 134 | <sgmltag>IndexTerm</sgmltag> should appear. <literal>Global</literal> means the index |
| 135 | for the whole collection of documents, <literal>Local</literal> means the index |
| 136 | for this document only, and <literal>All</literal> means both indexes. |
| 137 | </para> |
| 138 | </listitem> |
| 139 | </varlistentry> |
| 140 | <varlistentry><term>significance</term> |
| 141 | <listitem> |
| 142 | <para> |
| 143 | <sgmltag class="attribute">Significance</sgmltag> specifies whether or not |
| 144 | this <sgmltag>IndexTerm</sgmltag> is considered the most important location |
| 145 | for information about the terms being indexed. Generally, |
| 146 | <literal>Preferred</literal> <sgmltag>IndexTerm</sgmltag>s get special typographic |
| 147 | treatment in the <sgmltag>Index</sgmltag>. |
| 148 | </para> |
| 149 | </listitem> |
| 150 | </varlistentry> |
| 151 | <varlistentry><term>startref</term> |
| 152 | <listitem> |
| 153 | <para> |
| 154 | The use of <sgmltag class="attribute">StartRef</sgmltag> implies a spanning index |
| 155 | entry. <sgmltag class="attribute">StartRef</sgmltag> is used on the term that |
| 156 | defines the end of the span and points to the term which defines the |
| 157 | beginning. |
| 158 | </para> |
| 159 | </listitem> |
| 160 | </varlistentry> |
| 161 | <varlistentry><term>zone</term> |
| 162 | <listitem> |
| 163 | <para> |
| 164 | The use of <sgmltag class="attribute">Zone</sgmltag> implies a spanning index |
| 165 | entry. <sgmltag class="attribute">Zone</sgmltag> holds the &AT.ID;s of the elements |
| 166 | to which it applies. The <sgmltag>IndexTerm</sgmltag> applies to the contents |
| 167 | of the entire element(s) to which it points. If <sgmltag class="attribute">Zone</sgmltag> is used, the physical placement of the <sgmltag>IndexTerm</sgmltag> in the flow |
| 168 | of the document <emphasis>is irrelevant</emphasis>. |
| 169 | </para> |
| 170 | </listitem> |
| 171 | </varlistentry> |
| 172 | </variablelist> |
| 173 | </refsect1> |
| 174 | <refsect1 condition='ref.elem.seealso'><title>See Also</title> |
| 175 | &indexterm.seealso.gen; |
| 176 | </refsect1> |
| 177 | <refsect1><title>Examples</title> |
| 178 | |
| 179 | <informalexample role="example-source"> |
| 180 | <programlisting>&indexterm.example.1.txt;</programlisting> |
| 181 | </informalexample> |
| 182 | |
| 183 | <anchor id="ex.os.indexterm.1" role="HACK-ex.out.start"/> |
| 184 | &indexterm.example.1.gen; |
| 185 | <anchor id="ex.oe.indexterm.1" role="HACK-ex.out.end"/> |
| 186 | |
| 187 | <informalexample role="example-source"> |
| 188 | <programlisting>&indexterm.example.2.txt;</programlisting> |
| 189 | </informalexample> |
| 190 | |
| 191 | <informalexample role="example-source"> |
| 192 | <programlisting>&indexterm.example.3.txt;</programlisting> |
| 193 | </informalexample> |
| 194 | |
| 195 | &indexterm.example.seealso.gen; |
| 196 | </refsect1> |
| 197 | </refentry> |
| 198 |