TEI is a flavour of XML that is particularly suited to working with text.

The guidelines defining the TEI XML format are maintained by the Text Encoding Initiative (TEI), a community of people and practices in the academic field of digital humanities, focusing on text-centric information.

The TEI format differs from other well-known open formats for text (such as HTML and OpenDocument) in that it is primarily semantic rather than presentational. The TEI guidelines specify the semantics and interpretation of every tag and attribute. This includes some 500 different textual components and concepts (word, sentence, character, glyph, person etc.), each grounded in one or more academic discipline. The guidelines include comprehensive examples. (See Resources for links.)

The basic TEI template format is similar to the following:

<TEI xmlns="http://www.tei-c.org/ns/1.0">




<title>Document Title</title>












<p>Written by OpenOffice</p>












<p>Document Content</p>





The following examples are taken from the TEI guidelines:

Prose tags

TEI allows texts to be marked up semantically at any level of granularity, or mixture of granularities. For example this paragraph (p) has been marked up into sentences (s) and clauses (cl).


<cl>It was about the beginning of September, 1664,

<cl>that I, among the rest of my neighbours,

heard in ordinary discourse

<cl>that the plague was returned again to Holland; </cl>



<cl>for it had been very violent there, and particularly at

Amsterdam and Rotterdam, in the year 1663, </cl>

<cl>whither, <cl>they say,</cl> it was brought,

<cl>some said</cl> from Italy, others from the Levant, among some goods

<cl>which were brought home by their Turkey fleet;</cl>


<cl>others said it was brought from Candia;

others from Cyprus. </cl>



<cl>It mattered not <cl>from whence it came;</cl>


<cl>but all agreed <cl>it was come into Holland again.</cl>




TEI has tags for marking up verse. This example (taken from the French translation of the TEI Guidelines) shows a sonnet:

<div type="sonnet">

<lg type="quatrain">

<l>Les amoureux fervents et les savants austères</l>

<l> Aiment également, dans leur mûre saison,</l>

<l> Les chats puissants et doux, orgueil de la maison,</l>

<l> Qui comme eux sont frileux et comme eux sédentaires.</l>


<lg type="quatrain">

<l>Amis de la science et de la volupté</l>

<l> Ils cherchent le silence et l'horreur des ténèbres ;</l>

<l> L'Érèbe les eût pris pour ses coursiers funèbres,</l>

<l> S'ils pouvaient au servage incliner leur fierté.</l>


<lg type="tercet">

<l>Ils prennent en songeant les nobles attitudes</l>

<l>Des grands sphinx allongés au fond des solitudes,</l>

<l>Qui semblent s'endormir dans un rêve sans fin ;</l>


<lg type="tercet">

<l>Leurs reins féconds sont pleins d'étincelles magiques,</l>

<l> Et des parcelles d'or, ainsi qu'un sable fin,</l>

<l>Étoilent vaguement leurs prunelles mystiques.</l>



Choice tag

The choice tag is used to represent sections of text for which there are more than one possible option. In the following example, based on one in the standard, choice is used twice, once to indicate an original and a corrected year and once to indicate an original and regularised spelling.

<p xml:id="p23">Lastly, That, upon his solemn oath to observe all the above

articles, the said man-mountain shall have a daily allowance of

meat and drink sufficient for the support of <choice>



</choice> of our subjects,

with free access to our royal person, and other marks of our





Created with the Personal Edition of HelpNDoc: Full-featured Help generator