<index-sort-as>

The <index-sort-as> element specifies a sort phrase under which an index entry would be sorted.

This element gives an author the flexibility to sort an index entry in an index differently from how its text normally would be sorted. The common use for this is to disregard insignificant leading text, such as punctuation or words like "the" or "a". For example, the author might want <data> to be sorted under the letter D rather than the left angle bracket (<). An author might want to include such an entry under both the punctuation heading and the letter D, in which case there can be two index entry directives differentiated only by the sort order.

Certain languages have special sort order needs. For example, Japanese index entries might be written partially or wholly in kanji, but need to be sorted in phonetic order according to its hiragana/katakana rendition. There is no reliable automated way to map written to phonetic text: for kanji text, there can be multiple phonetic possibilities depending on the context. The only way to correctly sort Japanese index entries is to keep the phonetic counterparts with the written forms. The phonetic text would be presented as the sort order text for indexing purposes.

When an <index-sort-as> element is specified, processors that sort the containing index term MUST construct the effective sort phrase by prepending the content of the <index-sort-as> element to the textual content of its parent <indexterm> element. This ensures that two index entries with the same <index-sort-as> element but different base sort phrases will sort in the appropriate order, and will not merge into a single index entry.

An <index-sort-as> element provides sort phrase information for the <indexterm> that is its parent; therefore, in a multiple level <indexterm>, the <index-sort-as> only affects the level in which it occurs.

It is an error if there is more than one <index-sort-as> child for a given <indexterm>. An implementationmight give an error message, and might recover from this error condition by ignoring all but the last <index-sort-as>.

When located within the <indexterm> element, the <sort-as> element is equivalent to <index-sort-as>. It is an error for an <indexterm> element to directly contain both <sort-as> and <index-sort-as> elements.

Content models

See appendix for information about this element in OASIS document type shells.

Inheritance

+ topic/index-base indexing-d/index-sort-as

Example

This is an example of an index entry for <data> that will be sorted as "data":

<indexterm>&lt;data&gt;<index-sort-as>data</index-sort-as></indexterm>

Attributes

The following attributes are available on this element: Universal attribute group and @keyref.