Heads and labels

Comparison of headings and labels, and the use of head and label

Headings and labels overlap to some degree and their separate functions—while to some extent intuitive—are not clearly distinguished in TEI. Since there are certain contexts in which both are permitted, some discussion may be helpful in deciding which to use.

Headings, in general, give a name for a chunk of text, while labels provide information about the sequencing or identification of a series of text chunks. The typical example of a heading is a chapter heading, or the title of a poem or essay. The typical label expresses the sequence of list items or numbered paragraphs. Clearly in some cases the two functions are combined: for instance, in chapter headings that also contain sequencing information (Chapter 1: The Monk). In such cases, the heading function always trumps the labelling function.

Here is an overview of contexts where the head element is appropriate and should be used in preference to label:

All headings at the top of text, front, body, back, and div: in other words, the highest-level headings in the document; this includes chapter headings, section headings, essay and poem titles, headings for acts and scenes in drama.

An overview of contexts where the label element is appropriate and should be used in preference to head: as sequence indicator or other prefix for paragraphs, list items, notes, and similar textual features.

There are a great many elements in TEI where label is permitted, but where it probably makes no sense to use it except in very rare cases. For instance, it is permitted as the first child of body, foreign, title, damage, and a range of other elements where it makes equally little sense. For this reason you should think carefully about how you use it, to ensure semantic consistency.