Module 0: Introduction to Text Encoding and the TEI
5. TEI P3 (SGML) #
The sample text could be encoded in TEI P3 as well. Being TEI, this is a descriptive encoding scheme that allows the encoder to explicate the structure and semantics of the textual features s/he wants to analyse. In our sample, we see the typical features of TEI documents (although some of the names have evolved since version P3): a document is encoded in a <TEI.2> element, containing both a <teiHeader> section for the meta-information, and a <text> part for the actual text contents. The header must contain a minimal amount of meta-information, while the text content itself is encoded in <body>. Inside the text, the structural elements (heading — <head>, paragraph — <p>, footnote — <note @place=foot>), as well as semantic features (title — <title>, emphasis — <emph>, term — <term>) can be fully expressed with comprehensible tag names.
Notice, however, that this is SGML, not XML: some elements can occur without end tags (<title>, <body>, <p>, <head>), and attribute values can occur without surrounding quotes (“type=foot”).