TEI by ExampleModule 2: The TEI HeaderRon Van den BrandenEdward VanhoutteMelissa TerrasAssociation for Literary and Linguistic Computing (ALLC)Centre for Data, Culture and Society, University of Edinburgh, UKCentre for Digital Humanities (CDH), University College London, UKCentre for Computing in the Humanities (CCH), King’s College London, UKCentre for Scholarly Editing and Document Studies (CTB) , Royal Academy of Dutch Language and Literature, BelgiumCentre for Scholarly Editing and Document Studies (CTB)Royal Academy of Dutch Language and LiteratureKoningstraat 189000 GentBelgiumctb@kantl.beEdward VanhoutteMelissa TerrasCentre for Scholarly Editing and Document Studies (CTB) , Royal Academy of Dutch Language and Literature, BelgiumCentre for Scholarly Editing and Document Studies (CTB) , Royal Academy of Dutch Language and Literature, BelgiumGentCentre for Scholarly Editing and Document Studies (CTB)Royal Academy of Dutch Language and LiteratureKoningstraat 189000 GentBelgium
Licensed under a Creative Commons Attribution ShareAlike 3.0 License
9 July 2010TEI by Example.Edward VanhoutteeditorRon Van den BrandeneditorMelissa Terraseditor
TEI by Example offers a series of freely available online tutorials walking individuals through the different stages in marking up a document in TEI (Text Encoding Initiative). Besides a general introduction to text encoding, step-by-step tutorial modules provide example-based introductions to eight different aspects of electronic text markup for the humanities. Each tutorial module is accompanied with a dedicated examples section, illustrating actual TEI encoding practice with real-life examples. The theory of the tutorial modules can be tested in interactive tests and exercises.
en-GBtechnical revisioncorrected significant typo (biblStruct for biblFull), removed ref around gireleasecorrected typos + examplescreation
Module 2: The TEI Header
As will be clear by now, a document is more than its text. The TEI addresses this reality by providing formal means (elements and attributes) that allow the encoder to explicate his theory of the text in a descriptive manner. For example, when a text fragment is italicised in an existing source text or should occur as such in an electronic text edited from scratch, TEI allows the encoder to express not just that this fragment is emphasised (by means of italics), but also why (because it is a title, foreign word, term, or whatever analysis the encoder wants to express).
This descriptive nature of TEI is not restricted to the actual textual contents of a document, but extends to the general meta-information one would like to associate with it. Therefore, the TEI Guidelines require that a TEI text instance be preceded by general meta-information. This administrative meta-section is called the TEI header. While the TEI header may be intimidatingly elaborated, this tutorial module will guide you through its different sections, and point out those sections you’ll most plausibly need when you start to encode texts with TEI.The TEI header has a less direct relationship to the text than the actual TEI text elements. After all, the TEI header is not intended to contain actual text contents, but rather abstractions from the information that is related to the document, much like a library catalogue record. Moreover, the TEI header differs from most other TEI structures in that it has a more rigid organisation, containing a number of mandatory elements and alternative options to encode information in a more or less formalised way. Therefore, this tutorial module will differ slightly from the others concerning the worked example, and ask a little more of your imagination.
Exploring a Minimal TEI Header
Let’s start this section with a mental exercise (though you are free to make it as physical as you want). Before the holidays, your partner presents you with a short list of book titles she would like to read. Since it is you who took a day off early, you take this wish list and set out to the public library. Most of the titles are easy to find, except for the somewhat more cryptic entry:
Balzac or Zola (don't know exactly) ?
something about a magic donkey (in English please!!!) -- sorry, dear, you're the best!
There are many ways you could approach this problem:
flesh out all works by Zola and Balzac on the library shelves and try to find the one(s) dealing with magic donkeyshave a look at the available titles in the translated literature sectiontry to google for more information first
Depending on how greatly you value your free time, you will probably start / end up asking the librarian, who will either scan her current knowledge of world literature or a catalogue of library records. Or, if you live in the twenty-first century, you will probably move to one of the library’s computer terminals, search for Balzac or Zola in the author field, narrow the search to English translations, and give it a try with donkey in the title field. If you lived in the twenty-second century, the search robot could probably analyse your search query, propose alternatives for unsuccessful search terms, and even suggest you’d give it a try with ass instead of donkey. For the time being, however, you’ll have to depend on your (librarian’s) world knowledge, patience, and/or creativity in order to find following information:
It is the last field of this library catalogue that will guide you to the right library shelf and a superb holiday. This exercise vulgarises the motivation to abstract primary information about bibliographic objects into fixed categories. In the analog world, this happened on printed library catalogue records; nowadays these are entered as digital records in databases of library catalogues. These fixed categories together make up an identity card of a literary work.
The TEI Guidelines consider such a virtual identity card an essential part of each TEI document. It must be encoded within a teiHeader element, before the actual text contents in the text part. The ID categories of the TEI header are the subject of this tutorial module. As a trade-off between exhaustivity and usability, the TEI Guidelines define a wide range of specific TEI Header elements, only a few of which are mandatory. A minimal TEI header for the work described in the catalogue record above would look as follows:
This example shows how a teiHeader element must contain a fileDesc (file description) element, providing a description of the electronic file. In order to be complete, it must consist of three subsections, in that order:
titleStmt: a title statement about the electronic textpublicationStmt: information on the publication of the electronic textsourceDesc: a bibliographic description of the source for the electronic text
The titleStmt element must minimally contain a title for the electronic text. Depending on the nature of this text, this title may repeat the original’s title, followed by a paraphrase like electronic version/transcription/edition. Details about the publication and source of the electronic text must be provided in publicationStmt and sourceDesc respectively. These details ca be given either as informal prose in loose paragraphs, or in specialised elements. Those are covered in detail in the next sections of this tutorial.
You will have noticed that this minimal example of a TEI header does quite a poor job providing an identity card of this novel, compared to the library record example above. However, there are two things of notice:
the TEI header is an integral part of any TEI document, and must precede the text element with the actual text contentthe TEI header minimally documents aspects of the title, publication, and source of the electronic text
Of course, the TEI header allows for much more descriptive sophistication. The most important sections of the TEI header are treated in the next sections of this tutorial.
The TEI header contains meta-information about the electronic text, and is considered an integral part of it. Therefore, the teiHeader element must precede the text part of any TEI text, documenting at least some aspects of the electronic text in a fileDesc element. A file description minimally contains information about the title of the electronic text in titleStmt, about its publication in publicationStmt, and bibliographic information about the source document from which it is derived sourceDesc.
The TEI Header Sections
The TEI header can consist of four major parts:
fileDesc (file description): bibliographic description of the electronic textencodingDesc (encoding description): description of the relation of the electronic text to its sourceprofileDesc (profile description): description of the context in which the electronic text was created, and classification informationrevisionDesc (revision description): description of the revision history of the electronic text
As indicated in , the bibliographic file description (fileDesc) is the sole mandatory section of any TEI header. When other header sections are present, they must occur in the order listed above.To ease visual recognition, the mandatory elements of TEI header (sub)sections are printed in red in the element overviews in this tutorial.
The File Description
The file description, in the fileDesc element, must occur as the first element in the TEI header. It contains a bibliographic description of the electronic text, and may consist of following subsections:
titleStmt (title statement): groups information about the title of the electronic text and those responsible for its intellectual contenteditionStmt (edition statement): groups information relating to the edition of the electronic textextent: describes the approximate size of the electronic textpublicationStmt (publication statement): groups information concerning the publication or distribution of the electronic textseriesStmt (series statement): groups information about the series in which an electronic text is publishednotesStmt (notes statement): collects together any notes providing information about the electronic text additional to that recorded in other parts of the bibliographic descriptionsourceDesc (source description): describes the source from which an electronic text was derived or generated
Of these subsections, only the title statement (titleStmt), publication statement (publicationStmt), and source description (sourceDesc) are mandatory.
The Title Statement
The title statement minimally lists the title of the electronic text in a title element. Next to the title, it provides room to list detailed information about the persons or institutions responsible for different aspects of the realisation of the electronic text.
title: contains the title for the electronic textauthor: contains the name of an/the author(s) of the electronic texteditor: contains the name of an/the editor(s) of the electronic textsponsor: specifies the name of a sponsoring organisation or institution for the realisation of the electronic textfunder: specifies the name of a party responsible for the funding of the realisation of the electronic textprincipal: supplies the name of the principal researcher responsible for the creation of an electronic textrespStmt (statement of responsibility): supplies a statement of responsibility for the intellectual content of the electronic text, where the specialised elements for authors, editors, etc. do not suffice or do not apply
Although the electronic text can be named anything, often its title will reflect the title of the source text (if any). In order to point out the distinction, it is advised to explicate the status of the electronic text in a phrase like an digital edition, an electronic transcription, or the like. The TEI Guidelines strongly advise to separate the title of an electronic text from the name of the file in which it is saved, as the latter is likely subject to change.
All elements inside titleStmt may occur as often as needed, in order to list all (sub)titles, authors, editors, or others responsible for the realisation of the electronic text. For example, the titleStmt section for our example could be expanded as follows:Notice how the order of the element inside titleStmt is free. Also, the funder element in the following example illustrates how the titleStmt elements may contain common phrase level elements, for example an address.
Notice the specific form of the respStmt statements of additional responsibilities. Each responsibility statement should contain a proper name inside name, identifying the responsible party, and describe the responsibility inside a resp element. When one person or institution has more than one responsibilities, these may be enumerated in a number of resp elements.
The example above lists the translator among the additional responsibilities. However, this can be understood as a kind of editor role, and hence encoded as editor. In order to distinguish between different kind of editorial responsibilities, the editor element has a specific role attribute, whose values can include translator, editor, compiler, illustrator, etc. Likewise, the author of the preface could be considered a kind of editor and encoded as such.
When encoding an electronic text, you might want to identify who is responsible for certain textual phenomena, such as additions, deletions, abbreviations and their solutions, annotations, etc. Many of the tags for such phenomena have a resp attribute, whose value should refer to an element formally identified elsewhere. Of course, the titleStmt provides an excellent location to provide such formal identification codes, by making use of the global xml:id attribute. This way, the textual phenomena in a transcription can be associated directly with both the name of the responsible parties, and their roles in realising the electronic text.
The example above could thus be rephrased as follows:
These identifications allow the encoder to distinguish, for example, between an editorial annotation and a note by the translator in the text:
The title statement (titleStmt) is the first mandatory subsection of the file description. It should at least contain a title element, providing a title for the electronic text. Besides the title, different parties can be identified that had been involved in the realisation of the electronic text: author (author), editor (editor), sponsor (sponsor), funder (funder), principal (principal). Other responsibilities may be encoded in a respStmt element, listing both the name of the responsible party (name), and its responsibilities in a list of resp elements. For reference purposes, it makes sense to formally identify the parties identified in the title statement with global xml:id attributes.
The Edition Statement
The edition statement provides detailed information about the edition of the electronic text (if applicable). Similar to editions of printed texts, electronic texts may be substantially revised in different versions. Somehow closer to the world of software programs, an edition of an electronic text can be compared to the release of a piece of software. For an electronic text, the alteration of its contents, or addition/expansion/removal of substantive (types of) meta-information could qualify a new version of an electronic text as a new edition.
The editionStmt element can contain:
p | edition: a description of the edition; either as loose prose paragraphs (p), or in a specific edition elementrespStmt: contains descriptions of responsibilities specific to the current edition
The edition may be described either loosely in one or more paragraphs (p), or in a more specific edition element. One of both (but not both) must be present. Notice that only one edition element may be used. When applicable, responsible parties and their specific responsibilities for this edition can be listed inside a respStmt element, identifying both the responsible party (name) and its responsibilities (resp).
The TEI Guidelines state that
an edition statement is optional for the first release of a computer file; it is mandatory for each later release, though this requirement cannot be enforced by the parser.TEI Guidelines, 2.2.2 The Edition Statement
If, for example, the digital edition of this version of
The Wild Ass’s Skin builds on an existing electronic edition, but adds a substantive new category of annotations by Melissa Terras, this could be reflected in the editionStmt as follows:
Notice how we can’t formally identify Melissa anymore, at least not with the same identification code she received for the principal element, earlier in the header. Since xml:id values must be unique within a document, there are two options for identifying her in this role:
provide a different identification code for the xml:id attributemove the xml:id identification from the principal element inside titleStmt to the name element inside the editionStmt
The particular edition of the electronic text can be described in editionStmt, either as a loose prose description in one or more paragraphs (p), or one edition element. Additional responsibilities associated with this edition can be stated in one or more respStmt elements.
The extent section of the file description provides an analogue to the bibliographical indication of the size of printed books. It allows the encoder to express the size of the electronic text, be it in terms of its carrier medium (bits, bytes, number of disks / DVDs), or in terms of its contents (number of words/sentences). In this way, the TEI Guidelines aim to offer some way of formalising this often fluid notion of size in digital terms. The extent element may contain a loose prose description of the amount and units of size.
For example, the size of our example text could be encoded in a number of ways:
The extent section of the file description provides a means to record the size of the electronic text.
The Publication Statement
The publication statement (publicationStmt) is the second mandatory section of the file description. It provides details about the publication status of the electronic text, in one or more of following subsections:
The publication statement can either contain a loose prose description in one or more paragraphs (p), or any of the other elements (although the TEI Guidelines recommend to use at least publisher, distributor, or authority).
free: the text is freely availablerestricted: the text is not freely availableunknown: the status of the text is unknown
The idno element can be used to provide a formal identification code in some kind of classification scheme. The code itself must be given in plain text; the applicable identification scheme can be identified in the value of the type attribute. Suggested values are ISBN (International Standard Book Number), LCCN (Library of Congress Control Number), DOI (Digital Object Identifier), etc. The date element can give the date in free prose. Additionally, for processing purposes, the use of the when attribute is recommended. Its value should be a formal representation of the date, most commonly in the form yyyy-mm-dd.For a complete list of allowed date expressions in the date element’s when attribute: see W3C XML Schema Part 2: Datatypes Second Edition.
The publicationStmt for our sample text could look as follows:
Notice how the availability description contains a licence element, whose target attribute is pointing to an online description of the licensing scheme.
The Series Statement
If the electronic text is published in a series, this series can be described in the seriesStmt element. It may contain following elements:
p | title: a description of the series, either in a loose prose description (p), or by naming the series inside titleidno: a standardised bibliographic identification code for the series in which the electronic text is publishedrespStmt: statement of responsibility for the realisation of the series
The series statement may either be given in loose prose inside paragraphs (p), or must at least name the title of the series (title). Additionally, an identification code for the series, and/or for the electronic text within the series, can be given inside idno with an appropriate value for its type attribute. Responsible parties for the realisation of the series can be listed in (a) respStmt element(s).
For example, our sample electronic text could be published in a series that could be described as follows:
Notice how the second idno element is used to identify the electronic text within the series. The type attribute indicates here that the identification refers to the sequence number of the instalments in the series. It could, of course, indicate other reference schemes as well (such as volumes, issues, ...).
Details on the series in which an electronic text was published may be recorded in the seriesStmt element. The series statement may either be given as loose prose inside paragraphs (p), or must at least name the title of the series (title). Additionally, an identification code for the series, and/or for the electronic text within the series, can be given inside idno with an appropriate value for its type attribute. Responsible parties for the realisation of the series can be listed in one or more respStmt elements.
The Notes Statement
The notesStmt section of the file description is reserved for additional information that is not covered in the general bibliographic description. Each piece of additional information should be encoded in a separate note:
The notesStmt section of the file description is reserved for additional information that is not covered in the general bibliographic description. Each piece of additional information should be encoded in a separate note
The Source Description
The source description inside sourceDesc is the third required subsection of the file description. It should contain one of following elements:
p | bibl | biblStruct | biblFull | listBibl: the bibliographic description of the source text; either as a loose prose description in a paragraph (p), a formal bibliographic description (either loose (bibl), structured (biblStruct), or exhaustive (biblFull)), or a list of bibliographic references (listBibl)
The source text of the electronic text can be described either as loose prose in one or more paragraphs (p), or by means of a more specialised bibliographical element (bibl, biblStruct, biblFull, listBibl).
Of course, not all texts are derived from a material source text. In fact, lots of TEI documents are encoded from scratch, just like regular text files produced with text processing software. For such texts, a kind of dummy statement can be given in a paragraph inside sourceDesc. For example, the sourceDesc element of this TBE tutorial module (a native TEI electronic document) looks as follows:
If possible, however, it is recommended to bibliographically describe the material source document using a more specialised TEI element for bibliographic description. The bibl, biblStruct, and biblFull elements share a common set of allowed child elements, but differ in their degree of completeness and strictness. The most informal of the specialised bibliographical elements is bibl, which allows a prose-like bibliographic description, possibly interspersed with bibliographic elements, the most important of which are:
author: the author of the source texteditor: the editor of the source textdistributor: the distributing agency of the source textpublisher: the publishing agency of the source textfunder: the funding agency of the source textprincipal: the principal researcher responsible for the realisation of the source textsponsor: the sponsoring agency of the source textrespStmt: other responsibilities for the source texttitle: the title of the source textdate: the publication date of the source textpubPlace: the publication place of the source textedition: the edition of the source textseries: the series in which the source text was publishedidno: a bibliographic reference code for the source textbiblScope: the scope of the bibliographic reference of the source textextent: the size of the source text
The sourceDesc for our example could look as follows:
... or with a bibl element:
... more formally:
The same information can be structured more rigorously using the biblStruct element. A structured bibliography may contain the same bibliographic elements, but structured in a more explicit way on three possible levels:
analytic: bibliographic description of an item published within a monograph or journal: title: the title of the article or contributionauthor: the author of the article or contributioneditor: the editor of the article or contributionrespStmt: other responsibilities for the article or contributionmonogr: bibliographic description of an item published as an independent item: author: the author of the monographeditor: the editor of the monographrespStmt: other responsibilities for the monographtitle: the title of the monographimprint: information regarding the publication of the monograph: biblScope, distributor, pubPlace, publisher, datebiblScope: the bibliographic scope of the monograph (volume, issue)note: additional bibliographical notes for the monographseries: bibliographic description of the series in which a work has been published: title: the series’ titleeditor: the series’ editorrespStmt: other responsibilities for the seriesbiblScope: the bibliographic scope for the bibliographic item within the series
Our example could be elaborated as follows:
The biblFull element requires the most extensive bibliographic description for the source of the electronic text, organised in the same categories as the file description of the electronic text itself (without the sourceDesc section, of course): a mandatory title statement (fileDesc), optional edition statement (editionStmt), indication of the size (extent), mandatory publication statement (publicationStmt), series statement (seriesStmt), and possibly additional bibliographic notes (notesStmt). As this level of detail exceeds the aims of this introductory tutorial, you are kindly referred to the biblFull reference section of the TEI Guidelines for full reference and examples.
If an electronic text is derived from more than one source text, these can all be described with the desired granularity using bibl, biblStruct, and biblFull. When doing so, listBibl provides a convenient way to group these bibliographic descriptions inside sourceDesc.
Although our example text is derived from only one source, following example illustrates how listBibl can be used:
When the dedicated msdescription TEI module for Manuscript Description is included in a TEI schema, the sourceDesc section of the TEI header contains a specific element for the bibliographic description of the source manuscript for the electronic text: msDesc. Due to the extensiveness of this element and the specificity of its use, you are referred to the TEI Guidelines for a full reference on how to bibliographically describe source manuscripts. Chapter 10 Manuscript Description of the TEI Guidelines is nearly completely devoted to this element.The description of the material sources for an electronic text inside sourceDesc is the third mandatory subsection of the file description. It must contain either a prose description of the source in one or more paragraphs (p), or a more formalised description using one of the specific TEI elements for bibliographic description: bibl, biblStruct, or biblFull. When an electronic text is derived from more source texts, these descriptions may be grouped inside a listBibl element.
The file description (fileDesc) is the first and sole mandatory section of the TEI header. It contains a description of the electronic text, in a mandatory title statement (titleStmt), a description of the specific edition of the electronic text is published (editionStmt), the file size (extent), a mandatory description of publication details of the electronic text (publicationStmt), a description of the series in which the electronic text is published (seriesStmt), additional bibliographic notes (notesStmt), and a mandatory bibliographic description of the electronic text’s material source text (sourceDesc).
When all pieces are put together, the file description for our example can look as follows:
The Encoding Description
The encoding description, in the encodingDesc element, is the second major section of the TEI header. It documents the relationship between the electronic text and its source text, either as loose prose in one or more paragraphs, or in minimally one of more specific elements. Some of these specific elements provide details on the editorial principles for the transcription, and/or the project in which the electronic text originated:
editorialDecl (editorial practice declaration): description of aspects of the editorial practice that informed the creation of the electronic textprojectDesc (project description): description of the aims and circumstances of project that informed the creation of the electronic text
Besides these descriptive subsections, the encoding declaration is the place where reference systems are defined or declared that can be used anywhere in the document:
tagsDecl (tagging declaration): information about the tags used for the encoding of the electronic textrefsDecl (reference system declaration): declaration of reference systems used in the encoding of the electronic textclassDecl (classification declaration): declaration of classification scheme(s) used to classify the electronic text elsewhere in the document
Finally, the encoding description can contain subsections that are only enabled when specific TEI modules are included in the TEI schema:
metDecl (metrical notation declaration): declaration of the notation for metrical analyses of poetryvariantEncoding: declares the method used to encode text-critical variants
Besides these elements, the encoding description can contain other subsections as well, dealing with, for example, a sampling declaration for text collections (samplingDecl), a declaration of nonstandard characters (charDecl), the applications used for processing the electronic text (appInfo), etc. Due to their specificity, these elements are not discussed in this introductory tutorial; see section 2.3 The Encoding Description of the TEI Guidelines for full coverage.
The Editorial Practice Declaration
The editorial policy used when marking up the electronic text can be documented in editorialDecl, either as loose prose in one or more paragraphss, or in minimally one specific element. Following elements are most common:
correction: describes if / how / when corrections have been made in the text. A status attribute can indicate the degree of correction applied to the text (low, medium, high, or unknown); a method attribute can formalise whether corrections have been applied silently (silent) or explicitly (markup).normalization: describes if / how / when the text has been normalised. A source attribute can point to the description of the authority for the normalisations; a method attribute can formalise whether normalisations have been applied silently (silent) or explicitly (markup).quotation: describes how quotation marks in the original have been treated in the electronic text. A marks attribute can record the degree to which quotation marks have been retained in the electronic text (none, some, or all).hyphenation: describes how hyphenated text in the original has been treated in the electronic text. An eol attribute can record the degree to which end-of-line hyphenation has been retained in the electronic text (none, some, all, or hard (only hard end-of-line hyphenation has been retained)).interpretation: describes what interpretive information has been added to the text, apart from the transcription
All of these elements must contain at least one paragraph (p) containing the description.
For our example, the editorialDecl subsection could look as follows:
The editorialDecl subsection of the encoding description documents the editorial practice that has been adopted for the encoding of the electronic text. It may consist of either a loose prose in one or more paragraphs, or more specialised elements describing the editorial policy concerning corrections (correction), normalisation (normalization), quotation (quotation), hyphenation (hyphenation), and interpretation (interpretation).
The Project Description
The aims and purposes for which the electronic text have been created can be given in projectDesc, as well as any other information regarding this endeavour. The structure of projectDesc is simple: it consists simply of one or more paragraphs (p).
The projectDesc subsection of the encoding description provides more information about the aims and goals for which the electronic text has been created. This is provided as a prose description in one or more paragraphs (p).
The Tagging Declaration
The XML elements that have been used to mark up the text can be formally documented in the tagsDecl subsection of the encoding description. Following aspects can be documented:
namespace: formally identifies the namespace to which the XML elements belong that are documented in its tagUsage childrenrendition: declares a rendering style for one or more XML elements in the electronic text
Inside tagsDecl, the XML tags occurring within an electronic text can be documented with tagUsage elements, grouped within a namespace element. The namespace element must include a formal reference to the namespace of these XML elements in its name attribute. For any default TEI text, this namespace reference should point to the http://www.tei-c.org/ns/1.0 namespace definition. Each distinct XML element occurring within the text part of the electronic text should be documented in its own tagUsage element, providing a prose description for the use of this element in the electronic text. The element name must be provided in the gi (generic identifier) attribute. Additionally, the number of occurrences can be recorded in an occurs attribute, and the number of occurrences with a unique identification code can be given in a withId attribute. A rendition attribute can point to a standard rendering style for this element in the source text:
Notice how the listing of the distinct elements in an electronic text and their occurrences (with ID code) can only be provided after the completion of the encoding, before publication. The counting of all unique text elements and their occurrences is typically a task that can be automated, for example by using XSLT or XSLT 2.0 stylesheets. The TEI Wiki has a dedicated section with useful XSLT snippets: if you can’t figure out how to perform a specific XSLT job for your TEI files, the XSLT section on the TEI Wiki may be a good place to start looking for inspiration.
Of course, if your electronic document contains elements from other namespaces, these should be documented within their dedicated namespace element. Notice how the rendition attribute points to the definition of a rendering style somewhere else in the document. The tagging declaration is the place for such definitions as well, by means of different rendition elements for each distinct rendition style. The description of rendition styles can be done either as a loose prose description, with an idiosyncratic hand-crafted formal vocabulary, or make use of existing styling languages such as CSS (Cascading Style Sheets) or XSL FO (eXtensible Stylesheet Language: Formatting Objects). The scheme attribute defines one of these styles: css (CSS), xslfo (XSL FO), free (informal free text description), or other (any other formal rendition scheme). The contents of the rendition element then can provide the formal rendition rules expressed in any of the schemes identified. For example, the styles division and paragraph can be defined in terms of CSS rules as follows:
Notice how the xml:id value of the rendition elements is used to refer to these definitions with the rendition attribute. This is a global attribute, that can occur on any TEI element, so general rendition declarations can be used for individual (groups of) elements as well. Have a look, for example, at the main title on the title page:
...appearing as large red text in small caps, this title can be encoded as follows:
The tagsDecl subsection of the encoding declaration can document all tags, their usage, and rendition in the electronic document. Specific rendition styles can be defined with a rendition element, whose scheme attribute identifies the formal rendition scheme. Documentation for all unique tags occurring inside the electronic document’s text element should be grouped per namespace to which they belong, within a namespace element. Its name attribute must point to a formal definition of that namespace. Each unique tag of that namespace then can be documented with a dedicated tagUsage element, containing a prose description, the tag’s name in the gi attribute, and indications for its occurrence within the electronic document, either in general (the occurs attribute), or with a unique identification code (withId).
The Reference System Declaration
Any reference schemes that are used in the electronic text can be declared in the refsDecl subsection of the encoding description. They can be defined either as loose prose descriptions in one or more paragraph (p), or with specialised elements. Because of the complexity of these specialised elements, this tutorial section only treats the informal prose description.For more information on the means for formal documentation of complex reference schemes inside refsDecl, see section 2.3.5 The Reference System Declaration of the TEI Guidelines.
The reference system declaration may be used to document any reference system used in the electronic text, for example the numbering schemes in n attributes of certain elements, the composition of xml:id values for certain elements, and so on.
For example, the numbering scheme of paragraphs, and identification codes of chapters could be documented as follows in the example text:
Any reference scheme used in the electronic text can be documented in the refsDecl subsection of the encoding declaration. The description can happen either informally in one or more paragraphs, or more formally in specific TEI elements (not treated in this introductory tutorial).
The Classification Declaration
If you want to classify the electronic text using some kind of classification scheme or taxonomy, this taxonomy should be defined inside the classDecl subsection of the encoding description. The actual classification of the text is done in another part of the TEI header (see ), but it must point to one of the taxonomies defined here. The classification schemes used in the electronic document must each be defined in a dedicated element:
taxonomy: defines a typology used to classify texts
The taxonomy element can either refer to an existing classification scheme, or define an own classification scheme, and should be formally identified in an xml:id attribute. If the taxonomy refers to an existing classification scheme, this should be described in a bibl element. The library record for our example text contains a reference to the Dewey Decimal Classification (DDC) scheme (see code 082 in ). If we want to include this classification code, and the Library of Congress Subject Headings in our electronic version of the text, these schemes should be referred to in a taxonomy element as follows:
If the classification scheme is less universal, or if you want to roll your own, the taxonomy element can be used as well. Apart from an optional bibliographical reference in bibl, the classification categories can be defined in separate category elements, each with their own xml:id identification code. The category can be described in a catDesc element. As classification categories can nest, it is possible to define hierarchical classification systems. For example, it could make sense to classify this novel in the terms of the Balzac’s own plan of the Comédie Humaine, which the author envisaged as the encompassing series for his complete prose oeuvre:
In this example, a separate taxonomy is created for Balzac’s
Comédie Humaine, indicated with the identification code BCS. It consists of 6 subcategories, each in its own category element, and a more detailed value for its xml:id attribute. Some of these categories contain even further categories. These categories can be referred to in the actual text classification further in the TEI header (see ).
If the TEI header contains a formal text classification, the classification schemes used must be defined in the classDecl subsection of the encoding description. Each classification scheme should be identified by means of the xml:id attribute on a taxonomy element. Such taxonomy declarations can either refer to public classification schemes, with a bibl element, or define their own classification categories inside specific category elements. Such category descriptions should describe the category in a catDesc element.
The Metrical Notation Declaration (available in the verse module)
When the TEI module verse is included in the TEI schema, the encoding description contains an additional element for the declaration of the metrical notation used in the analysis of poetry: metDecl.
for a discussion of the elements in the TEI verse module for a discussion of how to include the TEI verse module in a TEI schema
The metrical notation may be defined either informally, in one or more paragraphs (p), or formally using one or more metSym elements. An informal declaration may look as follows:
This system can be declared more formally via one or more metSym (metrical notation symbol) elements. Each metrical symbol to be used in an analysis in the electronic text must be defined in the value attribute, and described in the text contents of a metSym element. The previous example could be formalised as follows:
After having declared the notation system for metrical analysis in the header, you can use this notation system for metrical analyses in the electronic text. For example, if you consider following section in the text of
The Wild Ass’s Skin a poem:
You can enrich the transcription with a metrical analysis by means of the specific met attribute. It should contain the symbols for the metrical notation system you declared in the metDecl subsection of the encoding description:
When the verse TEI module is included in a TEI schema, the encoding description contains a specific subsection for the declaration of metrical notation systems: metDecl. It can contain either an informal prose description of such a system in one or more paragraphs (p), or make use of more formalised metSym (metrical notation symbol) elements. Their value attributes must specify a symbol for a metrical phenomenon that is described as their text contents. This metrical notation system can then be used in the specific met attribute on poetic structures in the electronic text.
The Variant Encoding (available in the textcrit module)
When the TEI module textcrit is included in the TEI schema, the encoding description contains an additional element for the declaration of the method used to indicate text-critical variants: variantEncoding.
for a discussion of the elements in the TEI textcrit module for a discussion of how to include the TEI textcrit module in a TEI schema
The variantEncoding element is an empty element with two mandatory attributes. With the method attribute, you must identify one of three methods for the encoding of text-critical variants in the electronic text:
location-referenced: apparatus entries are anchored to identified locations in the textdouble-end-point: apparatus entries are anchored to the precise start and end point of the lemma in a base textparallel-segmentation: apparatus entries contain all text variants as alternative readings
For a full reference of these systems, see chapter 12 Critical Apparatus of the TEI Guidelines.
A second aspect that must be documented for the system used for the encoding of text-critical variants, is the location of the text-critical apparatus. This must be done in the location attribute, with two possible values:
internal: the text-critical apparatus is encoded within the running textexternal: the text-critical apparatus is encoded outside the running text
If we wanted to create a digital text-critical edition of
The Wild Ass’s Skin by collating different editions of the novel, we should include the textcrit module in our TEI schema and declare the system used to represent the textual variation in variantEncoding. The following declaration, for example, specifies that the textual variation is encoded in the running text, using the parallel-segmentation method:
For a full treatment of recording textual variation in critical editions, see .
When the textcrit TEI module is included in a TEI schema, the encoding description contains a specific subsection for the declaration of the encoding system for textual variation: variantEncoding. It is an empty element that must have two attributes. The method attribute indicates which of three methods is used to encode textual variation (location-referenced, double-end-point, or parallel-segmentation). The location attribute specifies where the critical apparatus is located: internal or external to the base text.
The encoding description (encodingDesc) is the second section of the TEI header. It describes the relationship between the electronic text and its source text, either as loose prose in one or more paragraphs, or in minimally one of more specific elements. Aspects that can be documented are the editorial practice (editorialDecl), the project context in which the electronic text was realised (projectDesc), a declaration of all XML elements used in the encoding (tagsDecl), declaration of reference systems used in the encoding (refsDecl), and a declaration of any classification schemes used to classify the text (classDecl). When the verse TEI module is included in the TEI schema, the system for metrical analysis can be declared in the metDecl element. When the TEI schema includes the textcrit TEI module for the encoding of text-critical variants, the system used for variant encoding may be documented in variantEncoding.
In the previous sections, we added the encoding description for our electronic edition of
The Wild Ass’s Skin, describing the editorial principles, the aim and purposes of the encoding, the different XML elements, their use and rendition, the system(s) that will be used to classify the text (further in the header), the notation system for metrical analyses of poems in the text, and the method of recording textual variation for the text-critical edition. This amounts to following encoding description:
The Profile Description
The profile description, in the profileDesc element, is the third major section of the TEI header. It can be used to document all kinds of non-bibliographic information about an electronic text, either as loose prose in one or more paragraphs, or in minimally one of more specific elements. The most important subsections are:
creation: information about the creation of a textlangUsage (language usage): information about the languages used in the texttextClass (text classification): classification of the contents of the text, according to a classification scheme
Besides these general subsections, some TEI modules add other specific subsections to the profile description. When the transcr TEI module for the description of primary sources is included in a TEI schema, following element can be used in profileDesc: handNotes: identification of the different hands in a primary document
Besides these elements, the corpus TEI module can add more elements to describe specific aspects of the compilation of a language corpus. These are not covered in this introductory tutorial; for a full reference, see section 15.2 Contextual Information of the TEI Guidelines.
If there are any details worth recording about the actual place or time of creation of the source text, this can be done in the creation element, as a loose prose description. This may be useful when the text was created long before its publication, as an exact situation in place and time can be important to certain types of research (e.g., study of (diachronic) linguistic variation). It is worth pointing out the difference between the use of the creation element, for details about the creation of a source text; and the sourceDesc element, for bibliographic details about the publication of the source text.
The creation element can provide a prose description of the circumstances in which a source text was created, such as its actual time and place of writing.
The langUsage subsection of the profile description provides room to describe the different languages used in the text. Each language must be described in a distinct language element. It may contain a prose description of the language (or dialect), and must provide a formal identification code for this language in the ident (identifier) attribute. When appropriate, the distribution of this language over the text contents can be stated as a percentage in a usage attribute. Section vi.1. Language identification of the TEI Guidelines offers recommendations for the constructions of the formal language identification codes for the ident attribute. It is important that these codes correspond to the values of the xml:lang attributes elsewhere in the electronic text to identify phrases in that language.
For example, the languages used in the English translation of
The Wild Ass’s Skin could be defined as follows:
The languages used in an electronic text can be formally declared in the langUsage subsection of the profile description. Each language can be described in a separate language element, which must contain a formal identification code in the ident attribute, and can provide details about the distribution of this language in the text in a usage attribute.
The contents of the text can be classified according to one or more classification schemes in the textClass subsection of the profile description. It can be done by means of three specific elements:
keywords: a list of keywords in a given keyword listclassCode: a classification code in a given classification schemecatRef: a list of pointers to specific categories in a given taxonomy
In general, these elements allow for two kinds of classification:
reference to an external classification scheme, which uses either subject headings (keywords), or classification codes (classCode)reference to specific categories in an internally defined taxonomy (catRef)
The keywords and classCode elements fulfil a similar role: they allow you to use classification categories defined in external classification schemes. If such a scheme defines categories in terms of subject headings, the keywords element should be used to refer to those keywords; if the scheme defines categories in terms of classification codes, the classCode element should be used. The classification scheme must be identified in the scheme attribute, which contains a pointer to its declaration in a taxonomy element inside the classDecl subsection of the encoding description (see ).
The keywords element must list the terms either in a series of term elements, or make use of a list structure. For example,
The Wild Ass’s Skin can be classified in terms of the Library of Congress Subject Headings scheme as follows:
...and / or in terms of the Dewey Decimal Classification Scheme like this (see code 082 in the library record above):
When you have defined your own classification system in the encoding description (see ), you can refer to one of its categories by means of the catRef element. This is an empty element that must point to the category definitions with a target attribute. This is basically a list of pointers to the xml:id attributes of the relevant categories in one of the taxonomy elements defined in the profileDesc section of the TEI header. If the reference to the category does not suffice, the scheme attribute may point to the declaration of the relevant taxonomy containing the category. For example,
The Wild Ass’s Skin could be classified using the Balzac-specific classification scheme declared above as follows:
An electronic text can be classified in the textClass subsection of the profile description. A classification can use a keyword (keyword) or a classification code (classCode) defined in an external classification scheme. The scheme attribute must be used to refer to the declaration of any external classification scheme in the classDecl subsection of the encoding description. Alternatively, the classification can be done using internally defined classification categories defined in the classDecl subsection of the encoding description. This is done by pointing to the definition of the relevant classification categories in the target attribute of a catRef element.
When the transcr TEI module for the transcription of primary sources is included in the TEI schema, the profile description contains an additional element for the declaration of the different hands occurring in the document handNotes.
for a discussion of the elements in the TEI transcr module for a discussion of how to include the TEI transcr module in a TEI schema
Each hand that occurs in the source text can be identified in a handNote element, containing a prose description of its characteristics. It should be identified with an xml:id attribute, and can contain additional attributes for formalised documentation of the script or writing style (script), writing medium (medium), and an indication of the prominence of this hand in the text (scope). If the document hand can be ascribed to a specific person, this person can be identified in the scribe attribute.
For example, the handNotes element could be used to identify the hand in which the previous owner of the book has added some annotations (supposed we wanted to transcribe these as well), as well as the Arabic script in this example:
When the transcr TEI module for the transcription of primary sources is included in the TEI schema, different hands in the source text can be identified in handNote elements inside a handNotes subsection of the profile description.
The profile description (profileDesc) is the third section of the TEI header. It describes all kinds of non-bibliographic information about an electronic text, either as loose prose in one or more paragraphs, or in minimally one of more specific elements. Aspects relating to the creation of the text can be documented in creation, the languages used in the document can be declared in langUsage, and a text classification can be provided in textClass. When the transcr TEI module for the representation of primary sources is included in the TEI schema, the different hands occurring in the source text can be formally documented in a handNotes element.
With the information about the text’s creation, languages, and classification in place, the profileDesc section of the TEI header for our sample text could look as follows:
The Revision Description
The fourth and final part of the TEI header is reserved for a detailed record of the revisions that have been made to the electronic text, in revisionDesc. Each revision is described in a dedicated change element. Additionally, it makes sense to formally identify the exact date of the change in a when attribute, and the person responsible for the change in a who attribute. The latter points to the definition of a person responsible for some aspect of the electronic text, which is probably defined in the titleStmt subsection of the file description section of the TEI header (see ).
Although ordering is arbitrary, it makes sense to sort the changes in chronological order, either ascending or descending. This optimises both readability and maintainability of this logbook, so that it can provide an instant overview of the complete history of the electronic text. For example:
The complete revision history of an electronic text can be documented in the revisionDesc section of the TEI header. Each change to the electronic file can be categorised and recorded in a separate change element. The when attribute can record the date of change, while the who attribute can be used to refer to an identified person responsible for some aspects of the text.
The Header of a Complex Text
Before we end, let’s go back to where we left you: the library, in front of the library catalogue or computer screen. Prepared for the possibility that this copy of the book may be in loan, you find another reference to
The Wild Ass’s Skin in the record of La Comédie Humaine (look for 505 8 0 |gPhilosophic and analytic studies: v. 41. The|tmagic skin; The Magic Skin is an alternative title for the English translation):
Now that’s a record! If you thought the truckload of possibilities for the description of electronic texts in the TEI header set your head spinning already, imagine what an electronic edition of
La Comédie Humaine might look like! Code 300 tells us that it has no less than 53 volumes, with different titles per volume.
One way of encoding this majestic work as a whole would be to treat
La Comédie Humaine as a kind of supertext containing all different works. This can be done in TEI by treating the whole as a teiCorpus, containing each separate work in its own TEI text. As each of these TEI texts needs its own TEI header, you can imagine the amount of meta-information, much of which will have to be repeated. This can be avoided by placing the common meta-information in the teiHeader element of the teiCorpus element, while retaining all work-specific meta-information in the TEI header section of the respective TEI text. This mechanism allows you to be maximally expressive in the description of all texts in a TEI corpus, and maximally efficient in the reduction of common information in the individual TEI headers.
The following example gives an impression of what a TEI header for an electronic edition of
La Comédie Humaine might look like:
The TEI Guidelines provide refined ways of associating contextual information with specific (parts of) texts. See section 15.3 Associating Contextual Information with a Text for more information.A complex text encoded as a teiCorpus should have a teiHeader in its own right. This TEI header on the corpus level can contain the general descriptive information about all corpus texts embedded as TEI documents. Each corpus text then should have its own teiHeader, describing only those aspects that are specific to that text.
After this overview of the most current header sections, it is time to put them all together and illustrate how a fairly detailed header for our sample text could look:
You have reached the end of this tutorial module covering the TEI header. You can now either proceed with other TEI by Example moduleshave a look at the examples section for the TEI header module.take an interactive test. This comes in the form of a set of multiple choice questions, each providing a number of possible answers. Throughout the quiz, your score is recorded and feedback is offered about right and wrong choices. Can you score 100%? Test it here!