🚧 Under construction — This page and its subpages are currently being revised. Contributions are welcome: feel free to edit and improve them.
Guide 1 of 6 — Understanding TEI documents for critical editions
Collection overview · Glossary · Next to Guide 2: Declaring witnesses in TEI critical editions
What you will build in this guide
Starting with one sentence,
The mind seeks unity.
you will progressively create a small TEI XML document containing:
TEI
├── teiHeader
│ └── basic file description
└── text
└── body
└── p [xml:id="p1"]
You will then create a minimal ConTeXt file that loads this TEI source and produces:
The mind seeks unity.
No previous knowledge of XML or TEI is required. Witnesses and critical apparatus entries are introduced only in the following guides.
Contents
-
1
Understanding TEI documents for critical editions
- 1.1 1. Where this guide fits in the collection
- 1.2 Part I — From plain text to TEI
- 1.3 2. From text to structured source
- 1.4 3. From XML to TEI
- 1.5 Part II — Stable structure and checking
- 1.6 4. Identifiers and references: from tree to network
- 1.7 5. Check the document
- 1.8 Part III — Connect TEI to ConTeXt
- 1.9 6. Load the TEI source with ConTeXt
- 1.10 7. What you have built
- 1.11 8. Continue with Guide 2
- 1.12 Related pages
This guide is a tutorial. Its purpose is not to provide a complete reference to XML or to the TEI Guidelines. Instead, it introduces the concepts required to build one small, inspectable source document and connect it to ConTeXt.
The same document will then be enriched in the following guides rather than replaced by a succession of unrelated examples.
1. Where this guide fits in the collection
The collection is cumulative. Each guide preserves what the preceding guides have established and adds one new layer.
GUIDE 1
basic TEI document
TEI
├── teiHeader
└── text
└── body
└── p [xml:id="p1"]
│
â–¼
GUIDE 2
add witness declarations
TEI
├── teiHeader
│ └── sourceDesc
│ └── listWit
│ ├── witness A
│ ├── witness B
│ └── witness C
└── text
└── body
└── p [xml:id="p1"]
│
â–¼
GUIDE 3
add basic apparatus relations
TEI
├── teiHeader
│ └── witness declarations
└── text
└── body
└── p
└── app
├── lem
└── rdg
│
â–¼
GUIDE 4
add complex textual variation
TEI
├── declarations
│ ├── witnesses
│ └── editorial responsibility
└── text
└── apparatus
├── omissions
├── corrections
├── conjectures
├── uncertainty
└── grouped readings
│
â–¼
GUIDE 5
process and validate the encoded relations
TEI source
│
â–¼
Lua processing
├── collect
├── normalize
├── resolve
├── validate
└── diagnose
│
â–¼
editorial records
│
â–¼
GUIDE 6
compose the scholarly page
editorial records
│
â–¼
ConTeXt
├── edited text
├── apparatus
├── witness sigla
├── notes
├── parallel texts
└── page layout
│
â–¼
typeset critical edition
How to read this diagram. Each guide adds one layer without discarding the preceding ones. Guide 1 creates the TEI container; Guide 2 gives textual sources stable identities; Guides 3 and 4 encode progressively richer textual variation; Guide 5 interprets and validates those relations; Guide 6 turns the resulting editorial structures into a readable scholarly page.
Stage reached. We know exactly what Guide 1 must accomplish: create the small TEI container on which the rest of the collection will build.
Part I — From plain text to TEI
2. From text to structured source
2.1. Begin with ordinary text
Consider a simple sentence:
The mind seeks unity.
A human reader can recognise this as a sentence and can infer that it might belong to a paragraph, chapter, quotation, or edited passage.
A computer initially receives only a sequence of characters. Nothing in that sequence explicitly says:
this is a paragraph this belongs to a text this is part of an edition this passage has an identity
The first task is therefore not to change the text but to make some of its structure explicit.
2.2. Add markup
Markup adds an explicit structural label:
<p>The mind seeks unity.</p>
The textual content has not changed.
The markup now identifies the content as a paragraph:
paragraph └── The mind seeks unity.
The start tag
<p>
opens the element, and
</p>
closes it.
2.3. Element, attribute, and textual content
We can now give the paragraph a stable identifier:
<p xml:id="p1">The mind seeks unity.</p>
This small fragment already contains three different kinds of information:
element: p
│
├── attribute
│ ├── name: xml:id
│ └── value: p1
│
└── textual content
└── The mind seeks unity.
How to read this diagram. The element identifies a structural unit. The attribute adds information about that unit. The textual content contains the characters represented by the element.
| Component | Role | Example |
|---|---|---|
| Element | Identifies or contains a structural part | <p>...</p>
|
| Attribute | Adds information about an element | xml:id="p1"
|
| Textual content | Contains the represented characters | The mind seeks unity.
|
Technical note. XML attribute values must be quoted. These guides use double quotation marks consistently:
xml:id="p1"
Further reference.
For definitions of element, attribute, textual content,
xml:id, and related terms, see the
Glossary.
For a broader introduction to XML syntax and descriptive markup, see the TEI P5 Gentle Introduction to XML.
2.4. Markup and typography are different things
The element
<p>The mind seeks unity.</p>
states that the content is a paragraph.
It does not state:
- which font to use;
- which size to use;
- whether the first line is indented;
- what line spacing is required;
- where the paragraph appears on a page.
Those decisions belong to processing and presentation.
STRUCTURED SOURCE
<p>The mind seeks unity.</p>
│
│ identifies structure
â–¼
processing
│
│ determines presentation
â–¼
TYPOGRAPHICAL OUTPUT
How to read this diagram. The structured source says what a piece of content is. A later processing and typesetting layer decides how that structure should be presented.
The same encoded paragraph might later become:
- an ordinary paragraph in a book;
- part of a parallel text;
- a diplomatic transcription;
- a web representation;
- a passage associated with a critical apparatus.
Guiding principle. Markup describes what the content is. Typesetting determines how that content appears. Keeping those responsibilities separate makes the encoded source reusable.
2.5. Read XML as a tree
XML elements may contain other elements:
<text>
<body>
<p xml:id="p1">The mind seeks unity.</p>
</body>
</text>
This nesting produces a hierarchy:
text
└── body
└── p [xml:id="p1"]
└── The mind seeks unity.
How to read this tree. body is a child of
text; p is a child of body. The
nesting of the XML elements creates the hierarchy. Indentation merely makes
that hierarchy easier for a human reader to see.
If two paragraphs share the same parent, they are siblings:
body
├── p
│ └── The mind seeks unity.
└── p
└── Reason examines knowledge.
A processor can use this tree to ask questions such as:
- Which paragraphs belong to the body?
- Which elements have identifiers?
- Which content belongs to a particular paragraph?
- Later, which apparatus entries occur inside a passage?
- Which readings belong to an apparatus entry?
Technical note. Empty elements may use a self-closing form such as
<lb/>. We will introduce them only when they become useful
in later examples.
Stage reached. We can now read a simple XML fragment as structured data rather than as a flat character string.
3. From XML to TEI
3.1. XML supplies syntax; TEI supplies a scholarly vocabulary
XML means Extensible Markup Language. It supplies a general syntax for describing structured information through:
- elements;
- attributes;
- textual content;
- nesting;
- identifiers;
- references.
XML itself does not prescribe a vocabulary for textual scholarship.
For example, the following can be well-formed XML:
<edition>
<metadata>
<title>A small example</title>
</metadata>
<maintext>
<paragraph>The mind seeks unity.</paragraph>
</maintext>
</edition>
But well-formed XML is not automatically TEI.
A TEI representation uses the TEI vocabulary:
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
...
</teiHeader>
<text>
<body>
<p>The mind seeks unity.</p>
</body>
</text>
</TEI>
Both examples use XML syntax. The difference lies in the vocabulary, the documented meanings of the elements, and the structural expectations of the TEI model.
The mind seeks unity.
│
│ add markup
â–¼
<p>The mind seeks unity.</p>
│
│ XML supplies:
│ elements, attributes,
│ nesting and references
â–¼
+-----------------------------+
| XML |
| structural syntax |
+-----------------------------+
│
│ TEI supplies an agreed
│ scholarly vocabulary
â–¼
+-----------------------------+
| TEI |
| TEI, teiHeader, text, p ... |
+-----------------------------+
│
│ the editorial project
│ adds actual evidence
â–¼
+-----------------------------+
| TEI EDITION |
| sources, witnesses, |
| readings, apparatus ... |
+-----------------------------+
│
│ ConTeXt processes
│ selected structures
â–¼
+-----------------------------+
| PRESENTATION |
| text, notes, apparatus, PDF |
+-----------------------------+
How to read this diagram. XML provides the general structural syntax. TEI adds a shared scholarly vocabulary. An editorial project uses that vocabulary to encode a particular body of evidence. ConTeXt then turns selected structures into a typographical presentation.
Do not confuse syntax with vocabulary. XML and TEI are not competing formats. XML supplies the structural syntax; TEI uses that syntax to provide a documented scholarly vocabulary and model.
Further reference.
- Glossary — definitions of XML , TEI , element , attribute , namespace , and related terms;
- XML in ConTeXt — general ConTeXt XML-processing mechanisms;
- TEI XML — broader orientation to TEI XML processing with ConTeXt;
- TEI P5 Guidelines — the normative TEI reference;
- TEI P5: A Gentle Introduction to XML — an introduction to the XML concepts used by TEI.
3.2. The two branches of a TEI document
A minimal TEI document has two principal branches:
TEI DOCUMENT
│
+---------------+---------------+
│ │
â–¼ â–¼
teiHeader text
"What is this resource?" "What text is encoded?"
│ │
â–¼ â–¼
fileDesc body
│ │
source information textual content
│ │
later enriched later enriched
│ │
â–¼ â–¼
witness declarations app / lem / rdg
How to read this diagram. The left branch documents the encoded resource and its sources; the right branch contains the encoded text. Guide 2 will enrich the left branch with witness declarations. Guides 3 and 4 will enrich the right branch with apparatus structures and more complex textual relations.
Why this matters. Witness declarations belong to the documentary structure of the edition. Readings and apparatus entries belong to the encoded text. Understanding these two branches now makes the later guides much easier to follow.
Further reference.
For the terminology used here, see the Glossary.
For a broader introduction to the TEI document model and its processing with ConTeXt, see TEI XML.
3.3. Build the minimal TEI header
For the tutorial we need only a very small header:
<teiHeader>
<fileDesc>
<titleStmt>
<title>A small critical-edition example</title>
</titleStmt>
<publicationStmt>
<p>Unpublished teaching example.</p>
</publicationStmt>
<sourceDesc>
<p>Created for the ConTeXt Garden TEI guides.</p>
</sourceDesc>
</fileDesc>
</teiHeader>
The three parts used here have distinct functions:
| Element | Function in this example |
|---|---|
<titleStmt>
|
Identifies the resource |
<publicationStmt>
|
Records its publication status |
<sourceDesc>
|
Describes the source from which the encoded resource derives |
Technical note. Real TEI headers can be much richer. They may record editors, translators, publication data, licensing, manuscript descriptions, bibliographical sources, and other documentary information. Guide 1 uses only what is required by this working example.
Further reference.
The TEI header is much richer than the minimal structure used in this tutorial. For the complete model, consult TEI P5, Chapter 2: The TEI Header.
The present guide introduces only the parts needed to construct the working example.
3.4. Add the textual branch
The other main branch contains the encoded text:
<text>
<body>
<p>The mind seeks unity.</p>
</body>
</text>
Its tree is:
text
└── body
└── p
└── The mind seeks unity.
Guide 1 deliberately uses only one paragraph. A larger text may later contain front matter, back matter, divisions, headings, quotations, verse, notes, and apparatus entries.
Further reference. For the fuller TEI model of textual structure,
including <front>, <body>,
<back>, groups, and textual divisions, see
TEI P5, Chapter 4: Default Text Structure.
3.5. Create
tei-guide-01.xml
Create a plain-text file named:
tei-guide-01.xml
Insert:
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>A small critical-edition example</title>
</titleStmt>
<publicationStmt>
<p>Unpublished teaching example.</p>
</publicationStmt>
<sourceDesc>
<p>Created for the ConTeXt Garden TEI guides.</p>
</sourceDesc>
</fileDesc>
</teiHeader>
<text>
<body>
<p>The mind seeks unity.</p>
</body>
</text>
</TEI>
This is the first complete TEI source in the tutorial.
Its tree is:
TEI
├── teiHeader
│ └── fileDesc
│ ├── titleStmt
│ │ └── title
│ │ └── A small critical-edition example
│ ├── publicationStmt
│ │ └── p
│ │ └── Unpublished teaching example.
│ └── sourceDesc
│ └── p
│ └── Created for the ConTeXt Garden TEI guides.
└── text
└── body
└── p
└── The mind seeks unity.
How to read this tree. The XML source and the tree are two views of the same structure. The XML is the actual source; the tree makes its hierarchy easier to inspect.
Stage reached. We now have a complete minimal TEI document with a header and a textual body. It contains no witnesses or apparatus entries yet — intentionally.
Part II — Stable structure and checking
4. Identifiers and references: from tree to network
So far the document is mainly hierarchical. Critical editions also require relationships between objects that may occur in different parts of the tree.
This is where identifiers and references become important.
4.1. Add a stable identifier
Change:
<p>The mind seeks unity.</p>
to:
<p xml:id="p1">The mind seeks unity.</p>
The paragraph now has a machine-readable identity:
p ├── xml:id: p1 └── The mind seeks unity.
For these guides, identifiers should:
- contain no spaces;
- remain unique within the document;
- remain stable where possible;
- identify an object rather than its changing appearance.
Useful forms include:
p1 chapter-1 witness-A ms-paris-123 app-0001
Avoid identifiers based on presentation:
first-paragraph-on-page-7 big-red-heading temporary-item
4.2. Machine identity and printed siglum are different
A manuscript might later have the machine identifier:
xml:id="ms-paris-123"
while a printed apparatus may use the siglum:
P
| XML identifier | Printed label or siglum |
|---|---|
| Used by the encoded data | Used by the reader |
| Must follow identifier rules | May follow editorial conventions |
| Should remain stable | May vary between publications |
ms-paris-123
|
P
|
Do not confuse identity with presentation. An xml:id
identifies an object inside the data model. A printed siglum belongs to the
reader-facing editorial presentation. They may correspond to one another,
but they do not perform the same function.
4.3. References point to identified objects
If an element has:
xml:id="p1"
another element can refer to that object with a value such as:
target="#p1"
Conceptually:
reference
#p1
│
â–¼
find xml:id="p1"
│
â–¼
identified object
How to read this diagram. An identifier declares an object. A
reference points back to that declaration. The leading #
indicates a reference to an identifier in the same XML document.
Further reference.
For the terminology used here, see the Glossary.
For the TEI mechanisms used to identify objects and create links between them, consult TEI P5, Chapter 17: Linking, Segmentation, and Alignment. The following guides apply the same principle to witness and apparatus references.
4.4. A TEI critical edition is both a tree and a network
Nesting expresses hierarchy:
TEI
└── text
└── body
└── p
References express relationships between identified objects.
Looking ahead to Guide 2, a witness declaration and a reading may later be related like this:
declaration
<witness xml:id="A">
â–²
│
│ wit="#A"
│
<rdg wit="#A">
│
â–¼
reading supported
by witness A
The two structures operate together:
HIERARCHY RELATION
TEI witness A
└── text â–²
└── body │
└── p │ wit="#A"
└── app │
└── rdg ─────────────┘
How to read this diagram. The left side tells us where a reading belongs in the document hierarchy. The right side tells us which declared witness supports that reading. A TEI critical edition therefore combines tree structure with reference relationships.
Guiding principle. Nesting tells us where an object belongs in the document tree. References tell us how identified objects are related. A TEI critical edition uses both.
Looking ahead. The <witness>,
<app>, and <rdg> elements in the
preceding diagram are not part of the Guide 1 working file. They preview the
mechanism that Guides 2 and 3 will introduce.
4.5. Update the working TEI file
The current source is now:
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>A small critical-edition example</title>
</titleStmt>
<publicationStmt>
<p>Unpublished teaching example.</p>
</publicationStmt>
<sourceDesc>
<p>Created for the ConTeXt Garden TEI guides.</p>
</sourceDesc>
</fileDesc>
</teiHeader>
<text>
<body>
<p xml:id="p1">The mind seeks unity.</p>
</body>
</text>
</TEI>
Stage reached. The TEI document now contains a stable machine-readable identifier. This is the same basic mechanism that later guides will use for witnesses, apparatus entries, and other scholarly objects.
5. Check the document
A usable scholarly source must pass several different kinds of check. These questions must not be collapsed into one.
TEI source
│
â–¼
+----------------------------+
| 1. XML WELL-FORMEDNESS |
| Are tags, attributes, and |
| nesting syntactically |
| coherent? |
+----------------------------+
│ yes
â–¼
+----------------------------+
| 2. TEI VALIDATION |
| Is this structure allowed |
| by the selected TEI model? |
+----------------------------+
│ yes
â–¼
+----------------------------+
| 3. EDITORIAL CHECK |
| Does the encoding describe |
| the evidence correctly? |
+----------------------------+
│
â–¼
usable scholarly source
How to read this diagram. Passing one level does not guarantee the next. A document may be well-formed XML but invalid TEI. It may also be valid TEI while containing a false scholarly claim.
Further reference.
For the formal distinction between XML well-formedness, validation, and TEI conformance, consult TEI P5, Chapter 24: Using the TEI, especially section 24.4 on conformance. The TEI P5 Gentle Introduction to XML also introduces validation from an XML perspective.
The present tutorial uses only the checks needed to understand the working example; project-specific schemas and ODD customization are beyond the scope of Guide 1.
5.1. Check XML well-formedness
For this working file, check that:
- there is exactly one root element;
- every opened element is closed;
- opening and closing names match;
- elements are correctly nested;
- attribute values are quoted;
- reserved characters are escaped where necessary.
Correct nesting:
<TEI>
<text>
<body>
<p>...</p>
</body>
</text>
</TEI>
A useful model is:
last opened
│
â–¼
first closed
Thus:
open TEI
open text
open body
open p
close p
close body
close text
close TEI
XML names are case-sensitive:
<TEI> <tei> <Tei>
are three different names.
Technical note. For this TEI project, also check that each
xml:id value is unique. Identifier uniqueness is an important
data-model requirement; it should not be confused with the basic syntactic
rules that define XML well-formedness.
5.2. Reserved characters
Some characters have structural meaning in XML.
For example, a literal ampersand in textual content must be written as:
&
so that:
<p>Reason & freedom</p>
represents:
Reason & freedom
Common predefined entities include:
| Entity | Character |
|---|---|
<
|
<
|
>
|
>
|
&
|
&
|
"
|
quotation mark |
'
|
apostrophe |
5.3. Well-formed XML is not necessarily valid TEI
This may be well-formed XML:
<TEI xmlns="http://www.tei-c.org/ns/1.0"> <banana>The mind seeks unity.</banana> </TEI>
Its XML syntax may be coherent. That does not make
<banana> an appropriate TEI structure at this location.
Validation asks a different question: whether the encoded structure conforms to the selected TEI model or schema.
5.4. Valid TEI does not guarantee correct scholarship
Even a structurally valid document may contain an incorrect scholarly claim.
For example, a reading may later be assigned to the wrong witness.
| Level | Question | Example problem |
|---|---|---|
| XML well-formedness | Is the syntax coherent? | Missing closing tag |
| TEI validation | Is the structure permitted? | Element used in an invalid context |
| Editorial correctness | Does the encoding represent the evidence accurately? | Reading attributed to the wrong witness |
A valid file can still contain a false claim. XML well-formedness and TEI validation can test formal structures. They cannot establish whether the textual or historical evidence has been interpreted correctly.
5.5. Practical checklist
Before using ConTeXt, check:
| Item | Expected result |
|---|---|
| File | tei-guide-01.xml
|
| Encoding | UTF-8 |
| Root | one <TEI>
|
| Namespace | http://www.tei-c.org/ns/1.0
|
| Header | one <teiHeader>
|
| Text | one <text>
|
| Body | one <body>
|
| Paragraph | <p xml:id="p1">
|
| Nesting | every child closes before its parent |
| Identifier | p1 occurs once as an xml:id
|
The expected tree is:
TEI
├── teiHeader
│ └── fileDesc
│ ├── titleStmt
│ │ └── title
│ ├── publicationStmt
│ │ └── p
│ └── sourceDesc
│ └── p
└── text
└── body
└── p [xml:id="p1"]
Stage reached. We now have a small, inspectable TEI source whose syntax, hierarchy, namespace, and identifier can be checked independently of its later typography.
Part III — Connect TEI to ConTeXt
6. Load the TEI source with ConTeXt
Guide 6 will develop the complete composition of a TEI critical apparatus. For now we ask only one question:
Can ConTeXt load the TEI tree and reach the paragraph?
6.1. Keep source and processing separate
The tutorial now contains two files:
SOURCE PROCESSING
tei-guide-01.xml tei-guide-01.tex
+---------------+ +----------------+
| TEI structure | | XML setups |
| text | | selection |
| identifiers | -----------> | formatting |
| later: | read | later: Lua |
| witnesses | | apparatus |
| readings | | layout |
+---------------+ +----------------+
│
â–¼
+---------------+
| PDF |
| visible text |
| apparatus ... |
+---------------+
How to read this diagram. The XML file is the scholarly source. The ConTeXt file contains the processing and presentation instructions. The source can therefore remain stable when the typography changes.
Guiding principle. The XML file stores the edition. The ConTeXt file tells ConTeXt what to do with that edition. A change in typography need not require a change in the encoded textual source.
6.2. Create
tei-guide-01.tex
Save a second file as:
tei-guide-01.tex
Place it in the same directory as:
tei-guide-01.xml
Use:
\xmlregisterns
{tei}
{http://www.tei-c.org/ns/1.0}
\startxmlsetups xml:tei:document
\xmlsetsetup{#1}
{tei:TEI|tei:text|tei:body}
{xml:tei:flush}
\xmlsetsetup{#1}
{tei:teiHeader}
{xml:tei:ignore}
\xmlsetsetup{#1}
{tei:p}
{xml:tei:paragraph}
\stopxmlsetups
\xmlregistersetup{xml:tei:document}
\startxmlsetups xml:tei:flush
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:tei:ignore
% The TEI header is not typeset in this first test.
\stopxmlsetups
\startxmlsetups xml:tei:paragraph
\par
\xmlflush{#1}
\par
\stopxmlsetups
\starttext
\xmlprocessfile
{tei}
{tei-guide-01.xml}
{}
\stoptext
The explicit namespace registration associates the local prefix
tei used in the ConTeXt selectors with the TEI namespace URI
declared by the XML document.
Technical note. The TEI source itself uses the default namespace and
does not need a tei: prefix in its element names. The prefix
above belongs to the ConTeXt processing layer and is used to select TEI
elements unambiguously.
Further reference.
For ConTeXt's XML setup mechanism and commands such as
\xmlsetsetup and \xmlflush, see
XML setup commands.
For the broader TEI → ConTeXt workflow, see TEI XML. Guide 1 uses only the small subset of XML commands needed to load the document and reach its paragraph.
6.3. Compile the ConTeXt file
Run:
context tei-guide-01.tex
The intended visible result is:
The mind seeks unity.
The TEI header is deliberately ignored in this first test.
6.4. Follow the processing path
tei-guide-01.xml
│
â–¼
ConTeXt loads the XML tree
│
â–¼
teiHeader is ignored in this test
│
â–¼
text and body are traversed
│
â–¼
the p element is processed
│
â–¼
its textual content is flushed
│
â–¼
The mind seeks unity.
How to read this diagram. ConTeXt does not simply print the XML file as text. It traverses selected structural elements, applies the setups associated with them, and finally flushes the textual content of the paragraph.
This small test does not yet:
- typeset the title in the TEI header;
- apply a complete page design;
- declare witnesses;
- inspect readings;
- build an apparatus;
- use Lua to construct editorial records.
Its only purpose is to establish:
TEI source
│
â–¼
ConTeXt XML processing
│
â–¼
visible text
6.5. If the file does not load
Check first:
- the XML filename;
- the directory;
- opening and closing tags;
- nesting;
- quoted attributes;
- the namespace;
- UTF-8 encoding.
Stage reached. ConTeXt can now read the structured TEI source and retrieve its textual content. The following guides will add editorial information to this same architecture.
7. What you have built
We began with:
The mind seeks unity.
and progressively constructed:
plain textual content
│
â–¼
<p>The mind seeks unity.</p>
│
â–¼
XML element + attribute + hierarchy
│
â–¼
TEI vocabulary
│
â–¼
TEI root + header + text
│
â–¼
xml:id="p1"
│
â–¼
checked structured source
│
â–¼
ConTeXt loading test
│
â–¼
visible text
How to read this diagram. The visible output is intentionally simple. The important achievement is that the sentence now belongs to a structured, identified, reusable TEI document whose presentation is controlled separately by ConTeXt.
The architecture now looks like this:
TEI DOCUMENT
│
+-------------+-------------+
│ │
â–¼ â–¼
teiHeader text
documentation textual data
│ │
│ â–¼
│ body
│ │
│ â–¼
│ paragraph p1
│
+-------- future guides --------+
│
+-------+-------+
│ │
â–¼ â–¼
witnesses app / lem / rdg
│ │
+-------+-------+
│
â–¼
Lua / ConTeXt
│
â–¼
scholarly page
How to read this diagram. Guide 1 has established the upper part of the structure: the TEI container, the documentary header, the textual body, and one identified passage. The lower part shows the layers that the next guides will add.
Reference vocabulary. This guide has introduced terms such as
element, attribute, XML tree, xml:id,
namespace, well-formed XML, and TEI validation. For definitions
and cross-references, use the
Glossary
rather than treating this tutorial as a complete reference manual.
Guide 1 complete. The basic TEI container is in place, one passage has a stable machine-readable identity, and ConTeXt can load the source.
8. Continue with Guide 2
The working document currently looks like this:
TEI
├── teiHeader
│ └── fileDesc
│ └── sourceDesc
│
└── text
└── body
└── p [xml:id="p1"]
Guide 2 will enrich the documentary branch:
TEI
├── teiHeader
│ └── fileDesc
│ └── sourceDesc
│ │
│ └── WITNESS DECLARATIONS ← GUIDE 2
│
└── text
└── body
└── p [xml:id="p1"]
How to read this diagram. Guide 2 does not replace the document built here. It adds declarations for the textual sources on which the edition depends, while the existing textual branch remains in place.
The cumulative route is therefore:
Guide 1
TEI container + identified passage
│
â–¼
Guide 2
witness identities
│
â–¼
Guide 3
basic apparatus relations
│
â–¼
Guide 4
complex textual variation
│
â–¼
Guide 5
processing + validation
│
â–¼
Guide 6
scholarly page composition
Guide 1 of 6 — Understanding TEI documents for critical editions
Collection overview · Glossary · Next: Declaring witnesses in TEI critical editions