About Arbortext Styler > Generating Indexes > Context Matching of Elements in Index Terms
  
Context Matching of Elements in Index Terms
When an index term contains child elements, those elements are processed inside the index for generated text and regular formatting. Note the following points regarding this processing:
The context of the element that Arbortext Styler selects to use in the index is based on the element hierarchy in the index, not in the body of the document.
The index term element, and its ancestors, are not part of the processing hierarchy. For example, when working with Element Model index terms, primary and secondary are part of the hierarchy but indexterm is not.
All child index term elements will always be descendants of _sfe:Index_index object name, the SFE that controls the formatting of the index generated by an index definition object.
You may encounter occurrences of an element that match in the body of the document but do not match in the index, and vice versa, or that match in both or neither. This may affect formatting or generated text settings you wish to make for an element that is used in an index term.
For example, refer to the index term markup given below:
<chapter>
<ixterm><one><two>Text</two></one></ixterm>
</chapter>
The table below shows how contexts would match in the body of the document and in the index:
Context
Match in body of document
Match in index
one everywhere
yes
yes
one in ixterm
yes
no
one anywhere in _sfe:Index_index object name
no
yes
two everywhere
yes
yes
two in one
yes
yes
two in one anywhere in chapter
yes
no
two in one anywhere in _sfe:Index_index object name
no
yes
You may encounter the example situations given below. Please find some suggestions for overcoming these issues:
A context will match for both document and index, but you want formatting or generated text configured for that context not to appear in an index.
For example, the context two in one in the table above.
Create a new context two in one anywhere in _sfe:Index_index object name and ensure it appears before the two in one context in the list of contexts configured for the element two. Apply the required formatting or generated text to this new context.
A context will not match for index, but you want formatting or generated text configured for that context to be reflected in its entry in the index.
For example, the context one in ixterm in the table above.
Create a new context one anywhere in _sfe:Index_index object name and with the same properties as one in ixterm.