Modelling with TEI
TEI Guidelines
The TEI Guidelines define and document the standard for electronic Text Encoding for Interchange (TEI). The Guidelines describe what TEI/XML elements and attributes are allowed and how they should be used. The Guidelines contain a declaration and description of each TEI element, code examples and several thematic chapters that explain how TEI elements and attributes should be used.
TEI is a language that was developed for modelling of various texts in the humanities. Therefore, TEI does not promote one model of a text, but is flexible enough to allow for a researcher to chose or create a model that suits her or his research needs. TEI has over 500 predefined elements organised in modules. Each module and the associated elements are described in the Guidelines. A TEI module groups together associated TEI elements such as the TEI elements recommended for the encoding of drama or dictionaries. There are also more general TEI modules which contain 'core' and 'header' elements, basic elements most likely to be used in all TEI documents. A full list of modules from the TEI guidelines:
| module name | description |
|---|---|
| analysis | Simple analytic mechanisms |
| certainty | Certainty and uncertainty |
| core | Elements common to all TEI documents |
| corpus | Header extensions for corpus texts |
| declarefs | Feature system declarations |
| dictionaries | Dictionaries and other lexical resources |
| drama | Performance texts |
| figures | Tables, formulae, and figures |
| gaiji | Character and glyph documentation |
| header | The TEI Header |
| iso-fs | Feature structures |
| linking | Linking, segmentation and alignment |
| msdescription | Manuscript Description |
| namesdates | Names and dates |
| nets | Graphs, networks and trees |
| spoken | Transcribed Speech |
| tagdocs | Documentation of TEI modules |
| tei | Declarations for datatypes, classes, and macros available to all TEI modules |
| textcrit | Text criticism |
| textstructure | Default text structure |
| transcr | Transcription of primary sources |
| verse | Verse structures |
Besides modules, the TEI elements and attributes are also organised in model classes and attribute classes. The model classes group elements together based on the location they are appearing. For instance, the model 'nameLike' groups elements that can be used to tag various names such as person name, place name, organisation name. A full list of model classes can be found as Appendix A of the Guidelines. Another important building block of TEI/XML documents are attributes. Attributes are used to store additional information about an element and its content. In the TEI attributes are grouped together in attribute classes. One of the most important attribute classes is the 'global' class. It groups together TEI attributes that can be used on all TEI elements such as the attribute @xml:id (used for an identifier) or @n (used for a number or label). Some classes have also subclasses. For instance, the 'global' class has a subclass 'global.rendition'. This subclass contains attributes that describe rendition and styling of an encoded textual feature. The attribute classes are listed and documented in the TEI guidelines in Appendix B.
Knowledge about TEI modules, model classes and attribute classes is essential for customisations. Customisations may be necessary in order to create a TEI model that is a close representation of a project-specific understanding of text.