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 may want <data> to be sorted under the letter D rather than the left angle bracket (<). An author may 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 may 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.

The <index-sort-as> element's content is logically augmented by the textual content of its parent <indexterm> element to produce the effective sort key (i.e., the textual content acts as a secondary sort field), so two indexterms with different content but the same <index-sort-as> value would never merge into a single index entry.

An <index-sort-as> element provides sort key 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 implementation may (but need not) give an error message, and may (but need not) recover from this error condition by ignoring all but the last index-sort-as.

Contains

Note

These models represent only the default document types distributed by OASIS. Actual content models will differ with each new document type.
Doctype Content model
topic (base), map (base), classifyMap, learningAssessment, learningBookmap, learningContent, learningMap, learningOverview, learningPlan, learningSummary ( text data or data or data-about or foreign or unknown or keyword or term) (any number)
topic (technical content), map (technical content), concept, ditabase, glossary, glossentry, glossgroup, reference, task, bookmap ( text data or data or data-about or foreign or unknown or keyword or apiname or option or parmname or cmdname or msgnum or varname or wintitle or term or abbreviated-form) (any number)
machineryTask ( text data or data or data-about or foreign or unknown or keyword or wintitle or term) (any number)

Contained by

Doctype Content model
topic (base), map (base), topic (technical content), map (technical content), concept, ditabase, glossary, glossentry, glossgroup, reference, task (strict), task (general), bookmap, classifyMap, machineryTask, learningAssessment, learningBookmap, learningContent, learningMap, learningOverview, learningPlan, learningSummary indexterm

Inheritance

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

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

Name Description Data Type Default Value Required?
keyref Keyref provides a redirectable reference based on a key defined within a map. See The keyref attribute for information on using this attribute. CDATA #IMPLIED No
univ-atts attribute group (includes select-atts, id-atts, and localization-atts groups) A set of related attributes, described in univ-atts attribute group
global-atts attribute group (xtrf, xtrc) A set of related attributes, described in global-atts attribute group
class A common attribute described in Other common DITA attributes

Was this helpful?