Encoding complex textual variation in TEI
π§ Documentation under construction β This page and its subpages are currently being revised. Contributions are welcome: feel free to correct, expand, and improve them.
Guide 4 of 6 β Encoding complex textual variation in TEI
Previous: Encoding a basic critical apparatus in TEI Β· Collection overview Β· Glossary Β· Next: Processing TEI critical apparatus data with Lua
Contents
- 1 1. Where this guide fits in the collection
- 2 2. Why simple substitution is not enough
- 3 3. Encoding absence and presence
- 4 4. Encoding corrections and documentary alterations
- 5 5. Encoding editorial responsibility and uncertainty
- 6 6. Encoding relationships between readings
- 6.1 6.1. Grouping related readings
- 6.2 6.2. The <rdgGrp> element
- 6.3 6.3. Grouping is an editorial claim
- 6.4 6.4. Transposed word order
- 6.5 6.5. Textual order and documentary transposition
- 6.6 6.6. Variants of unequal extent
- 6.7 6.7. Choosing apparatus boundaries
- 6.8 6.8. Combining several complex phenomena
- 7 7. A model collection of complex cases
- 8 8. Complete TEI MWE
- 9 9. Common encoding errors
- 9.1 9.1. Writing an omission abbreviation as textual content
- 9.2 9.2. Treating an uncertain reading as an omission
- 9.3 9.3. Assigning a conjecture to a witness
- 9.4 9.4. Using @resp without a declared target
- 9.5 9.5. Confusing deletion with omission
- 9.6 9.6. Flattening a substitution into an unexplained string
- 9.7 9.7. Grouping readings without explaining the group
- 9.8 9.8. Encoding printed punctuation inside readings
- 9.9 9.9. Fragmenting one meaningful variation arbitrarily
- 10 10. Structural and editorial checks
- 11 11. Inspecting complex variants with ConTeXt
- 12 12. A practical complex-variation checklist
- 13 13. What this guide has established
- 14 14. Next guide
- 15 Related pages
Guide 3 introduced the basic TEI apparatus entry:
<app> <lem wit="#ms-A">mind</lem> <rdg wit="#ms-B">soul</rdg> </app>
This model records a simple substitution:
mind β soul
Real critical editions also contain variations that cannot be reduced to one complete word replacing another.
A witness may:
- omit words preserved elsewhere;
- add words absent from other witnesses;
- contain a deletion, addition, or substitution made by a copyist;
- preserve an uncertain or partly illegible reading;
- support a reading proposed only conjecturally by an editor;
- transpose words or passages;
- agree with other witnesses only at a broader level;
- preserve a variant whose extent differs from that of the lemma.
This guide extends the basic apparatus model:
simple substitution
β
complex textual variation
βββ omission
βββ addition
βββ correction
βββ conjecture
βββ uncertainty
βββ grouped readings
βββ transposed order
βββ unequal textual extent
The objective is not to create final apparatus typography.
The objective is to record the editorial relations clearly enough that later processing can inspect, validate, select, and typeset them.
Guiding principle. TEI should record the editorial relation, not imitate the abbreviations or punctuation of a printed apparatus. Rendering decisions belong to later processing and typesetting.
1. Where this guide fits in the collection
The collection now follows this progression:
TEI document
β
witness declarations
β
basic apparatus entries
β
[COMPLEX TEXTUAL VARIATION] β Guide 4
β
Lua processing
β
ConTeXt typesetting
Guide 1 introduced the TEI document.
Guide 2 declared the witnesses.
Guide 3 encoded simple substitutions with:
<app>;<lem>;<rdg>;@wit.
This guide introduces:
- empty lemmas and readings;
- omissions and additions;
- documentary alterations;
<del>,<add>, and<subst>;- editorial conjectures;
@resp;- uncertain readings;
@certand<unclear>;- grouped readings;
<rdgGrp>;- transposed order;
- apparatus entries whose members have unequal extent;
- combinations of several phenomena.
This guide does not yet develop:
- Lua tables;
- global witness-reference resolution;
- automated validation reports;
- sorting and filtering;
- extraction of all apparatus entries;
- conversion of XML identifiers into printed sigla;
- final critical-apparatus typography.
Those subjects belong to Guides 5 and 6.
2. Why simple substitution is not enough
A simple apparatus entry assumes that every witness preserves some textual content at the same location:
A mind B soul C understanding
This can be encoded as:
<app> <lem wit="#ms-A">mind</lem> <rdg wit="#ms-B">soul</rdg> <rdg wit="#ed-C">understanding</rdg> </app>
But consider these cases:
Case 1 A divine reason B β C divine reason Case 2 A reason B eternal reason C reason Case 3 A reason and freedom B freedom and reason C reason and freedom
These relations involve:
Case 1 absence Case 2 additional text Case 3 changed order
The TEI source must preserve those distinctions without reducing every phenomenon to an artificial replacement string.
3. Encoding absence and presence
3.1. Absence is not a single phenomenon
Several situations may produce no readable text in an edition:
no text at this location
βββ genuine omission
βββ physical loss
βββ illegible writing
βββ erased text
βββ editorial suppression
βββ missing or unknown data
These situations must not be treated as synonyms.
| Situation | Editorial meaning | Possible TEI strategy |
|---|---|---|
| Omission | The witness does not transmit the passage | Empty <rdg/>
|
| Addition | One witness transmits text absent from the others | Empty lemma or empty reading for the witnesses without the text |
| Illegible writing | Writing exists but cannot be read securely | <unclear> or a more detailed source description
|
| Physical loss | The material support is damaged or missing | Elements from the primary-source transcription model |
| Deleted text | Text was written and then cancelled | <del>
|
| Unknown data | The encoder has not established the reading | Must not be silently represented as an omission |
The central rule is:
empty reading
β
unknown reading
β
illegible reading
β
deleted reading
Do not infer absence too quickly. An empty reading is an explicit editorial statement. Missing markup, unreadable writing, physical loss, and deleted text require different encodings.
3.2. Encoding an omission
Suppose that the witnesses read:
A The divine reason governs all. B The reason governs all. C The divine reason governs all.
The words divine are omitted by B.
At the variable location:
A divine B β C divine
The TEI entry may be encoded as:
<app> <lem wit="#ms-A #ed-C">divine</lem> <rdg wit="#ms-B"/> </app>
The empty element:
<rdg wit="#ms-B"/>
does not contain an invisible word.
It records that witness B supports an empty textual reading at this apparatus location.
The structure is:
app
βββ lem
β βββ text: divine
β βββ witnesses: A C
βββ rdg
βββ text: empty
βββ witness: B
A possible printed apparatus is:
divine] om. B
The abbreviation:
om.
belongs to the output convention.
It is not stored as the content of the reading.
Avoid:
<rdg wit="#ms-B">om.</rdg>
Prefer:
<rdg wit="#ms-B"/>
The relation remains:
TEI data
empty reading
ConTeXt output
om.
3.3. Encoding an addition
Now suppose that B contains a word absent from A and C:
A Reason governs all. B Eternal reason governs all. C Reason governs all.
At the variable location:
A β B eternal C β
One possible inline apparatus entry is:
<app> <lem wit="#ms-A #ed-C"/> <rdg wit="#ms-B">eternal</rdg> </app>
The structure is:
app
βββ lem
β βββ text: empty
β βββ witnesses: A C
βββ rdg
βββ text: eternal
βββ witness: B
A printed apparatus could show:
ante reason add. eternal B
or:
eternal add. B
depending on the projectβs conventions.
Again, the abbreviation and location formula belong to rendering.
They are not part of the reading text.
3.4. Omission and addition are relative descriptions
The same textual relation may be described differently depending on the edited text.
Suppose:
A reason B eternal reason C reason
If the edited text follows A and C:
Reason governs all.
B may be described as adding eternal.
If the edited text follows B:
Eternal reason governs all.
A and C may be described as omitting eternal.
| Edited text | Lemma | Alternative reading | Printed interpretation |
|---|---|---|---|
reason
|
Empty | eternal B
|
Addition in B |
eternal reason
|
eternal B
|
Empty A C | Omission in A and C |
The documentary evidence has not changed.
The lemma and the printed description depend partly on the editorial text.
Editorial perspective matters. βOmissionβ and βadditionβ describe a relation to the text selected as the lemma; they are not always intrinsic labels attached permanently to one witness.
3.5. Empty content and missing markup
These two fragments are not equivalent.
Explicit empty reading:
<rdg wit="#ms-B"/>
No reading element:
<app> <lem wit="#ms-A #ed-C">divine</lem> </app>
The first states:
B supports an empty reading
The second states only:
no alternative reading has been encoded here
The absence of an element does not automatically communicate the same information as an explicitly empty element.
4. Encoding corrections and documentary alterations
4.1. Corrections and alterations in witnesses
A manuscript may preserve several stages of writing.
For example, a copyist may first write:
soul
and then replace it with:
mind
This involves two related but distinct questions:
What reading should be associated with the witness?
β
mind
What physical intervention is visible in the witness?
β
soul deleted
mind added
A simple critical apparatus may record only the resulting reading:
<rdg wit="#ms-B">mind</rdg>
A more detailed transcription may preserve the alteration:
<rdg wit="#ms-B">
<subst>
<del>soul</del>
<add>mind</add>
</subst>
</rdg>
The choice depends on the purpose of the edition.
| Editorial purpose | Possible encoding |
|---|---|
| Record only the resulting textual state | <rdg>mind</rdg>
|
| Preserve the visible intervention | <subst> containing <del> and <add>
|
| Describe several hands or stages | Add hand, responsibility, or documentary information |
4.2. The <del> element
The element <del> identifies text that has been deleted.
For example:
<del>soul</del>
It says that the word was present in the source and was subsequently cancelled.
This differs from an omission:
omission
no corresponding transmitted text at this location
deletion
text was written and then cancelled
A deletion may be represented within a reading:
<rdg wit="#ms-B"> <del>soul</del> </rdg>
Whether deleted text counts as the textual reading used for collation depends on the editorial model.
4.3. The <add> element
The element <add> identifies text added to the source:
<add>mind</add>
It may represent:
- an interlinear addition;
- a marginal addition;
- text inserted above or below the line;
- a later correction;
- material supplied by another hand.
A detailed project may add further attributes describing:
- place;
- hand;
- responsibility;
- sequence.
This guide retains only the basic structure:
<add>mind</add>
4.4. The <subst> element
A substitution groups a deletion and an addition belonging to the same intervention:
<subst> <del>soul</del> <add>mind</add> </subst>
The tree is:
subst
βββ del
β βββ soul
βββ add
βββ mind
Inside a reading:
<rdg wit="#ms-B">
<subst>
<del>soul</del>
<add>mind</add>
</subst>
</rdg>
This records more than:
<rdg wit="#ms-B">mind</rdg>
The expanded structure states:
original written form
β
soul
β
deleted
β
replacement
β
mind
4.5. Textual variation and documentary alteration
The apparatus and the source transcription answer different questions.
| Critical-apparatus question | Documentary question |
|---|---|
| Which reading is supported by B? | What was written first? |
| How does B differ from A? | Was the word deleted, erased, or overwritten? |
| Which form appears in the edited text? | Where was the correction placed? |
| Which siglum should be printed? | Which hand made the intervention? |
A project may combine the two levels, but it should not confuse them.
Two complementary questions. A critical apparatus identifies competing textual readings; a documentary transcription records what happened materially on the page. Use the simplest encoding that preserves the evidence needed by the edition.
5. Encoding editorial responsibility and uncertainty
5.1. Editorial conjectures
Sometimes the editor adopts a reading not directly transmitted by any witness.
Suppose the witnesses read:
A mild B mild C mild
but the editor argues that the original text was:
mind
The conjectural lemma may be encoded with responsibility:
<app> <lem resp="#editor">mind</lem> <rdg wit="#ms-A #ms-B #ed-C">mild</rdg> </app>
The key distinction is:
wit="#ms-A"
support attributed to a textual witness
resp="#editor"
responsibility attributed to an editor
A conjectural reading must not be assigned to a manuscript that does not contain it.
Avoid:
<lem wit="#ms-A">mind</lem>
when A actually reads mild.
Prefer:
<lem resp="#editor">mind</lem>
with the transmitted reading encoded separately.
Never manufacture witness support. A conjecture belongs to the editorβs responsibility, even when it is adopted as the lemma. The transmitted readings must remain attributed to the witnesses that actually contain them.
5.2. Declaring editorial responsibility
A minimal header can identify the responsible editor:
<titleStmt>
<title>A teaching example of complex textual variation</title>
<respStmt xml:id="editor">
<resp>Editorial conjectures and apparatus encoding</resp>
<name>Example Editor</name>
</respStmt>
</titleStmt>
The apparatus can then refer to:
resp="#editor"
The relation is:
resp="#editor"
β
find xml:id="editor"
β
retrieve the responsibility statement
β
identify the responsible editor
As with witness references, the XML identifier is a machine-readable target.
The printed output may use:
- the editorβs surname;
- an abbreviation;
- a symbol;
- no explicit responsibility label.
5.3. Witness support and editorial responsibility
These attributes should remain conceptually distinct.
| Attribute | Answers | Example |
|---|---|---|
@wit
|
Which witnesses support this reading? | wit="#ms-A #ms-B"
|
@resp
|
Who is responsible for this editorial claim or intervention? | resp="#editor"
|
A reading may sometimes carry both kinds of information, but they do not mean the same thing.
5.4. Uncertain readings
Uncertainty may concern several different things:
uncertainty βββ uncertain decipherment βββ uncertain witness attribution βββ uncertain editorial reconstruction βββ uncertain grouping βββ uncertain degree of confidence
A project should state what its uncertainty markup means.
A low-confidence reading may be encoded as:
<rdg wit="#ms-B" cert="low">soul</rdg>
This records a reading whose interpretation is assigned low certainty.
The relation is:
reading
soul
witness
B
certainty
low
The attribute does not itself explain why the reading is uncertain.
That explanation may require:
- a note;
- a description of damage;
- an
<unclear>element; - a project-specific annotation.
5.5. The <unclear> element
When writing is present but difficult to decipher, the uncertain portion may be marked directly:
<rdg wit="#ms-B"> s<unclear>ou</unclear>l </rdg>
The structure is:
rdg βββ text: s βββ unclear β βββ ou βββ text: l
This is more precise than assigning uncertainty to the whole reading when only part of the word is doubtful.
Compare:
<rdg wit="#ms-B" cert="low">soul</rdg>
with:
<rdg wit="#ms-B"> s<unclear>ou</unclear>l </rdg>
| Encoding | Scope of uncertainty |
|---|---|
cert="low" on <rdg>
|
The reading as a whole |
<unclear> around part of the text
|
The marked characters or words |
5.6. Uncertain is not empty
Do not replace an uncertain reading with an empty element merely because the editor cannot read it confidently.
Empty reading:
<rdg wit="#ms-B"/>
Uncertain reading:
<rdg wit="#ms-B" cert="low">soul</rdg>
Partly unclear reading:
<rdg wit="#ms-B"> s<unclear>ou</unclear>l </rdg>
These encode three different editorial claims.
6. Encoding relationships between readings
Several readings may belong to a meaningful family.
Suppose:
A mind B soul C understanding D intellect
The editor may distinguish:
substantive alternatives βββ soul βββ understanding lexically related form βββ intellect
A reading group can make the classification explicit:
<app>
<lem wit="#ms-A">mind</lem>
<rdgGrp type="substantive">
<rdg wit="#ms-B">soul</rdg>
<rdg wit="#ed-C">understanding</rdg>
</rdgGrp>
<rdg wit="#ms-D">intellect</rdg>
</app>
The structure becomes:
app
βββ lem
β βββ mind
βββ rdgGrp [type="substantive"]
β βββ rdg
β β βββ soul
β βββ rdg
β βββ understanding
βββ rdg
βββ intellect
6.2. The <rdgGrp> element
The element <rdgGrp> groups related readings within an
apparatus entry.
A simple example is:
<rdgGrp type="orthographic"> <rdg wit="#ms-B">colour</rdg> <rdg wit="#ed-C">color</rdg> </rdgGrp>
The group may represent a project-specific classification such as:
- orthographic;
- grammatical;
- substantive;
- genealogical;
- corrected;
- secondary.
The value of @type should be documented by the project.
The group does not automatically assert that the readings are identical.
It states that the encoder has chosen to treat them as belonging together for a declared purpose.
6.3. Grouping is an editorial claim
Consider:
<rdgGrp type="orthographic"> <rdg wit="#ms-B">honour</rdg> <rdg wit="#ed-C">honor</rdg> </rdgGrp>
The grouping asserts:
honour
and
honor
β
treated as orthographically related
A different project might preserve them as entirely independent readings.
Therefore:
grouping
β
neutral formatting convenience
It is structured editorial interpretation.
Grouping is data. A reading group should express a documented analytical category, not merely provide a convenient visual arrangement.
6.4. Transposed word order
Suppose that the witnesses read:
A reason and freedom B freedom and reason C reason and freedom
For a basic critical apparatus, the divergent order can be encoded as a complete reading:
<app> <lem wit="#ms-A #ed-C">reason and freedom</lem> <rdg wit="#ms-B">freedom and reason</rdg> </app>
The tree is:
app
βββ lem
β βββ reason and freedom
β βββ witnesses: A C
βββ rdg
βββ freedom and reason
βββ witness: B
A possible printed apparatus is:
reason and freedom] freedom and reason B
This encoding records the textual result.
It does not describe physical transposition marks in the manuscript.
6.5. Textual order and documentary transposition
Two different phenomena must be distinguished.
| Phenomenon | Question | Strategy used here |
|---|---|---|
| Variant word order | What sequence does the witness transmit? | Encode the sequence as a complete <rdg>
|
| Physical transposition marks | How does the document instruct the reader to reorder written segments? | Use detailed primary-source transcription structures |
A detailed documentary transcription may identify segments and describe their intended reordered sequence with pointers.
That additional model is not required merely to record:
reason and freedom
versus
freedom and reason
in a basic textual apparatus.
6.6. Variants of unequal extent
A lemma and its reading need not contain the same number of words.
Suppose:
A divine and eternal reason B reason C divine reason
One apparatus entry may encode:
<app> <lem wit="#ms-A">divine and eternal reason</lem> <rdg wit="#ms-B">reason</rdg> <rdg wit="#ed-C">divine reason</rdg> </app>
The structure is:
app
βββ lemma
β βββ divine and eternal reason
βββ reading
β βββ reason
βββ reading
βββ divine reason
The entry records competing textual spans rather than word-by-word alignment.
6.7. Choosing apparatus boundaries
The editor must decide how much text belongs to one apparatus entry.
Consider:
A divine and eternal reason B reason C divine reason
One broad entry is:
<app> <lem wit="#ms-A">divine and eternal reason</lem> <rdg wit="#ms-B">reason</rdg> <rdg wit="#ed-C">divine reason</rdg> </app>
A more analytical encoding might divide the variation:
<app> <lem wit="#ms-A #ed-C">divine</lem> <rdg wit="#ms-B"/> </app> <app> <lem wit="#ms-A">and eternal</lem> <rdg wit="#ms-B #ed-C"/> </app> reason
These encodings are not interchangeable editorially.
| Broad entry | Several narrow entries |
|---|---|
| Preserves the larger phrase as one variant unit | Separates individual differences |
| Easier to read as a phrase-level relation | Easier to analyse component by component |
| May conceal internal agreements | May fragment a meaningful variant |
| Produces one apparatus entry | Produces several apparatus entries |
There is no universally correct boundary independent of editorial purpose.
The project should apply a consistent segmentation policy.
6.8. Combining several complex phenomena
One apparatus entry may combine more than one feature.
For example:
<app>
<lem resp="#editor">mind</lem>
<rdg wit="#ms-A #ed-C">mild</rdg>
<rdg wit="#ms-B" cert="low">
m<unclear>il</unclear>d
</rdg>
</app>
This records:
lemma βββ text: mind βββ responsibility: editor reading 1 βββ text: mild βββ witnesses: A C reading 2 βββ text: mild βββ uncertain internal characters βββ witness: B βββ overall certainty: low
Another example may preserve a correction:
<app>
<lem wit="#ms-A #ed-C">mind</lem>
<rdg wit="#ms-B">
<subst>
<del>soul</del>
<add>mind</add>
</subst>
</rdg>
</app>
Complexity should be introduced only when it represents information the edition actually needs.
7. A model collection of complex cases
The following examples summarise the principal structures introduced in this guide.
| Phenomenon | Basic TEI form |
|---|---|
| Omission | <rdg wit="#ms-B"/>
|
| Addition | Empty lemma plus a non-empty reading |
| Deletion | <del>...</del>
|
| Addition to a source | <add>...</add>
|
| Substitution | <subst><del>...</del><add>...</add></subst>
|
| Conjecture | Lemma or reading with @resp
|
| Low certainty | Reading with cert="low"
|
| Partly unclear text | <unclear>...</unclear>
|
| Reading group | <rdgGrp>...</rdgGrp>
|
| Transposed order | Complete reordered text inside <rdg>
|
| Unequal extent | Lemma and readings containing spans of different lengths |
8. Complete TEI MWE
Save the following file as:
tei-guide-04.xml
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Complex textual variation in TEI</title>
<respStmt xml:id="editor">
<resp>Editorial conjectures and apparatus encoding</resp>
<name>Example Editor</name>
</respStmt>
</titleStmt>
<publicationStmt>
<p>Unpublished teaching example.</p>
</publicationStmt>
<sourceDesc>
<listWit>
<witness xml:id="ms-A" n="A">
The principal manuscript.
</witness>
<witness xml:id="ms-B" n="B">
A later manuscript containing omissions and corrections.
</witness>
<witness xml:id="ed-C" n="C">
An early printed edition.
</witness>
<witness xml:id="ms-D" n="D">
A manuscript containing several secondary readings.
</witness>
</listWit>
</sourceDesc>
</fileDesc>
</teiHeader>
<text>
<body>
<p xml:id="p1">The
<app type="omission">
<lem wit="#ms-A #ed-C #ms-D">divine</lem>
<rdg wit="#ms-B"/>
</app>
reason governs all.
</p>
<p xml:id="p2"><app type="addition"><lem
wit="#ms-A #ed-C #ms-D"/><rdg
wit="#ms-B">Eternal</rdg></app> reason seeks unity.</p>
<p xml:id="p3">The
<app type="correction">
<lem wit="#ms-A #ed-C #ms-D">mind</lem>
<rdg wit="#ms-B">
<subst>
<del>soul</del>
<add>mind</add>
</subst>
</rdg>
</app>
seeks unity.
</p>
<p xml:id="p4">The
<app type="conjecture">
<lem resp="#editor">mind</lem>
<rdg wit="#ms-A #ms-B #ed-C #ms-D">mild</rdg>
</app>
seeks unity.
</p>
<p xml:id="p5">The
<app type="uncertain-reading">
<lem wit="#ms-A #ed-C #ms-D">mind</lem>
<rdg wit="#ms-B" cert="low">
s<unclear>ou</unclear>l
</rdg>
</app>
seeks unity.
</p>
<p xml:id="p6">The
<app type="grouped-readings">
<lem wit="#ms-A">mind</lem>
<rdgGrp type="substantive">
<rdg wit="#ms-B">soul</rdg>
<rdg wit="#ed-C">understanding</rdg>
</rdgGrp>
<rdg wit="#ms-D">intellect</rdg>
</app>
seeks unity.
</p>
<p xml:id="p7">
<app type="transposed-order">
<lem wit="#ms-A #ed-C #ms-D">reason and freedom</lem>
<rdg wit="#ms-B">freedom and reason</rdg>
</app>
belong together.
</p>
<p xml:id="p8">
<app type="unequal-extent">
<lem wit="#ms-A">Divine and eternal reason</lem>
<rdg wit="#ms-B">Reason</rdg>
<rdg wit="#ed-C #ms-D">Divine reason</rdg>
</app>
governs all.
</p>
</body>
</text>
</TEI>
This teaching document contains eight apparatus entries:
| Paragraph | Phenomenon | Principal structure |
|---|---|---|
p1
|
Omission | Empty reading |
p2
|
Addition | Empty lemma |
p3
|
Correction | <subst>
|
p4
|
Conjecture | @resp
|
p5
|
Uncertain reading | @cert and <unclear>
|
p6
|
Grouped readings | <rdgGrp>
|
p7
|
Transposed order | Reordered reading text |
p8
|
Unequal extent | Textual spans of different lengths |
8.1. Reading the complete document as a tree
TEI
βββ teiHeader
β βββ fileDesc
β βββ titleStmt
β β βββ title
β β βββ respStmt [xml:id="editor"]
β βββ publicationStmt
β βββ sourceDesc
β βββ listWit
β βββ witness A
β βββ witness B
β βββ witness C
β βββ witness D
βββ text
βββ body
βββ p1
β βββ app [omission]
β βββ lem: divine
β βββ rdg: empty
βββ p2
β βββ app [addition]
β βββ lem: empty
β βββ rdg: Eternal
βββ p3
β βββ app [correction]
β βββ lem: mind
β βββ rdg
β βββ subst
β βββ del: soul
β βββ add: mind
βββ p4
β βββ app [conjecture]
β βββ lem: mind
β β βββ resp: #editor
β βββ rdg: mild
βββ p5
β βββ app [uncertain-reading]
β βββ lem: mind
β βββ rdg
β βββ cert: low
β βββ unclear: ou
βββ p6
β βββ app [grouped-readings]
β βββ lem: mind
β βββ rdgGrp
β β βββ rdg: soul
β β βββ rdg: understanding
β βββ rdg: intellect
βββ p7
β βββ app [transposed-order]
β βββ lem: reason and freedom
β βββ rdg: freedom and reason
βββ p8
βββ app [unequal-extent]
βββ lem: Divine and eternal reason
βββ rdg: Reason
βββ rdg: Divine reason
8.2. Editorial relations in the complete MWE
The apparatus entries can be summarised as:
p1 divine A C D omission B p2 absence A C D Eternal B p3 mind A C D soul deleted and mind added B p4 mind conjectured by the editor mild A B C D p5 mind A C D partly uncertain soul B p6 mind A soul B understanding C intellect D p7 reason and freedom A C D freedom and reason B p8 Divine and eternal reason A Reason B Divine reason C D
9. Common encoding errors
9.1. Writing an omission abbreviation as textual content
Avoid:
<rdg wit="#ms-B">om.</rdg>
Prefer:
<rdg wit="#ms-B"/>
The processor can generate om..
9.2. Treating an uncertain reading as an omission
Avoid:
<rdg wit="#ms-B"/>
when writing exists but is difficult to read.
Use an uncertainty structure such as:
<rdg wit="#ms-B" cert="low">soul</rdg>
or:
<rdg wit="#ms-B"> s<unclear>ou</unclear>l </rdg>
9.3. Assigning a conjecture to a witness
Avoid:
<lem wit="#ms-A">mind</lem>
when A does not contain mind.
Prefer:
<lem resp="#editor">mind</lem>
and encode the transmitted reading separately.
9.4. Using @resp without a declared target
Avoid:
<lem resp="#unknown-editor">mind</lem>
when no object has:
xml:id="unknown-editor"
Declare the responsible party or responsibility statement in the header.
9.5. Confusing deletion with omission
Deletion:
<del>soul</del>
Omission:
<rdg wit="#ms-B"/>
The first records cancelled writing.
The second records an empty textual reading at the apparatus location.
9.6. Flattening a substitution into an unexplained string
Avoid:
<rdg wit="#ms-B">soul β mind</rdg>
This stores explanatory notation as textual content.
Use:
<rdg wit="#ms-B">
<subst>
<del>soul</del>
<add>mind</add>
</subst>
</rdg>
9.7. Grouping readings without explaining the group
Avoid an undocumented classification:
<rdgGrp type="group-1">
Prefer a meaningful and documented value:
<rdgGrp type="orthographic">
or:
<rdgGrp type="substantive">
9.8. Encoding printed punctuation inside readings
Avoid:
<rdg wit="#ms-B">soul B;</rdg>
Prefer:
<rdg wit="#ms-B">soul</rdg>
The semicolon and siglum belong to output processing.
9.9. Fragmenting one meaningful variation arbitrarily
Several apparatus entries may be syntactically possible but editorially misleading.
The apparatus boundaries should reflect a declared segmentation policy.
10. Structural and editorial checks
A complex apparatus entry should be checked at several levels.
| Level | Question |
|---|---|
| XML syntax | Are all elements and attributes well formed? |
| TEI structure | Are the elements permitted in the selected TEI model? |
| Reference integrity | Do @wit and @resp point to declared targets?
|
| Phenomenon | Does the markup distinguish omission, uncertainty, and deletion correctly? |
| Witness accuracy | Does every witness actually support the reading assigned to it? |
| Editorial responsibility | Are conjectures and interventions attributed correctly? |
| Segmentation | Do the apparatus boundaries represent meaningful variation units? |
| Project consistency | Are similar phenomena encoded in the same way? |
11. Inspecting complex variants with ConTeXt
This ConTeXt MWE is an inspection tool rather than a final critical apparatus.
Its purpose is to:
- load the complete TEI document;
- ignore the header;
- select every paragraph;
- print the lemma in the edited text;
- place the readings in footnotes;
- render an empty reading as
om.; - represent an empty lemma with the mathematical empty-set symbol;
- make deletions, additions, uncertainty, and witness references visible.
This MWE was tested successfully with ConTeXt LMTX.
Practical note. Save the XML source file and the ConTeXt file in the same directory. This allows the command \xmlprocessfile to find the XML file directly, without requiring an absolute or relative path.
Save the ConTeXt file as:
tei-guide-04.tex
\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}
\xmlsetsetup
{#1}
{tei:app}
{xml:tei:apparatus}
\xmlsetsetup
{#1}
{tei:lem}
{xml:tei:lemma}
\xmlsetsetup
{#1}
{tei:rdg}
{xml:tei:reading}
\xmlsetsetup
{#1}
{tei:rdgGrp}
{xml:tei:reading-group}
\xmlsetsetup
{#1}
{tei:subst}
{xml:tei:substitution}
\xmlsetsetup
{#1}
{tei:del}
{xml:tei:deletion}
\xmlsetsetup
{#1}
{tei:add}
{xml:tei:addition}
\xmlsetsetup
{#1}
{tei:unclear}
{xml:tei:unclear}
\stopxmlsetups
\xmlregistersetup{xml:tei:document}
\startxmlsetups xml:tei:flush
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:tei:ignore
% The TEI header is not typeset in this inspection test.
\stopxmlsetups
\startxmlsetups xml:tei:paragraph
\par
\dontleavehmode
\xmlflush{#1}
\par
\stopxmlsetups
\startxmlsetups xml:tei:lemma
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:tei:reading
\doifelse
{\xmltext{#1}}
{}
{om.}
{\xmlflush{#1}}
\space
\ttx{\xmlatt{#1}{wit}}
\doifsomething
{\xmlatt{#1}{cert}}
{\space
\itx{cert=\xmlatt{#1}{cert}}}
\quad
\stopxmlsetups
\startxmlsetups xml:tei:reading-group
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:tei:substitution
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:tei:deletion
\overstrike{\xmlflush{#1}}
\space
\stopxmlsetups
\startxmlsetups xml:tei:addition
\underbar{\xmlflush{#1}}
\stopxmlsetups
\startxmlsetups xml:tei:unclear
\underbar{\xmlflush{#1}}
\high{?}
\stopxmlsetups
\startxmlsetups xml:tei:apparatus
\xmlfirst{#1}{tei:lem}
\footnote
{\doifelse
{\xmlatt{#1}{type}}
{addition}
{\mathematics{\emptyset}}
{\xmlfirst{#1}{tei:lem}}}
\space
\xmlall{#1}{tei:rdg}}
\stopxmlsetups
\starttext
\subject{Complex TEI apparatus}
\xmlprocessfile
{tei}
{tei-guide-04.xml}
{}
\stoptext
Compile with:
context tei-guide-04.tex
The resulting PDF contains the following edited text:
Complex TEI apparatus The divineΒΉ reason governs all. Β² reason seeks unity. The mindΒ³ seeks unity. The mindβ΄ seeks unity. The mindβ΅ seeks unity. The mindβΆ seeks unity. Reason and freedomβ· belong together. Divine and eternal reasonβΈ governs all.
The corresponding footnotes contain information equivalent to:
1. divine] om. #ms-B
2. β
] Eternal #ms-B
3. mind] soul mind #ms-B
4. mind] mild #ms-A #ms-B #ed-C #ms-D
5. mind] soul #ms-B cert=low
6. mind] soul #ms-B;
understanding #ed-C;
intellect #ms-D
7. reason and freedom] freedom and reason #ms-B
8. Divine and eternal reason] Reason #ms-B;
Divine reason #ed-C #ms-D
The text above does not accurately reflect the result obtained with the PDF output after compilation. This result can be seen in the image below.
In the actual output:
- the deleted word
soulin note 3 is struck through; - the added word
mindin note 3 is underlined; - the uncertain characters in note 5 are underlined and marked with a raised question mark;
- the empty lemma in note 2 is represented by the mathematical empty-set symbol;
- the XML witness references are displayed in a monospaced typeface.
The processing path is:
tei-guide-04.xml
β
ConTeXt loads the TEI tree
β
the TEI header is ignored
β
each paragraph is processed
β
each apparatus entry selects its lemma
β
the lemma is printed in the edited text
β
readings are collected in a footnote
β
empty readings become βom.β
β
an empty lemma becomes ββ
β
β
documentary and uncertainty markup is made visible
β
raw witness references are printed
This inspection test does not yet:
- resolve XML witness identifiers into sigla;
- resolve editorial responsibility;
- construct location references;
- suppress redundant lemma support;
- choose between positive and negative apparatus styles;
- sort readings or witnesses;
- validate the apparatus globally;
- create the final compact apparatus.
Those functions belong to Guides 5 and 6.
12. A practical complex-variation checklist
Before moving to Guide 5, verify the following.
| Check | Expected result |
|---|---|
| Omission | Represented by an explicitly empty reading |
| Addition | Absence and added text are represented separately |
| Deleted text | Not confused with an omission |
| Substitution | Deletion and addition remain structurally distinct |
| Conjecture | Responsibility is recorded with @resp
|
| Responsibility target | The referenced editor or responsibility statement is declared |
| Uncertain reading | Not represented as empty merely because it is doubtful |
| Partial uncertainty | The uncertain characters or words are marked locally |
| Reading groups | Grouping criteria are meaningful and documented |
| Transposed order | The witnessβs actual textual sequence is preserved |
| Unequal extent | Lemma and readings contain the complete competing spans |
| Witness references | Every @wit value points to a declared witness
|
| Apparatus punctuation | Not embedded in the reading text |
| Segmentation | Similar variations follow a consistent boundary policy |
13. What this guide has established
This guide has extended the simple substitution model introduced in Guide 3:
simple substitution
β
omission and addition
β
documentary alteration
β
conjecture and responsibility
β
uncertainty and unclear text
β
grouped readings
β
transposed order and unequal extent
The central lesson is that apparently similar absences or changes may encode different editorial claims. An omission is not a deletion; uncertain text is not empty text; a conjecture is not witness evidence; and a reading group is not merely a formatting device.
The TEI source can now preserve both the textual alternatives and the information needed to interpret them:
TEI
βββ declarations
β βββ witnesses
β βββ editorial responsibility
βββ text
βββ complex apparatus entries
βββ empty lemmas and readings
βββ documentary alterations
βββ conjectures
βββ uncertainty
βββ reading groups
βββ reordered readings
βββ unequal textual spans
The next step is not to add more isolated TEI elements, but to process these structures consistently across the document.
14. Next guide
The TEI document now contains enough structured information to require systematic processing. Guide 5 shows how Lua can collect apparatus entries, normalize their fields, resolve references, validate the resulting records, and prepare reliable editorial data for ConTeXt.
Related pages
- Building critical editions from TEI XML
- Declaring witnesses in TEI critical editions
- Encoding a basic critical apparatus in TEI
- Glossary of terms used in the TEI XML critical edition guides
- TEI XML
- XML
- ConTeXt and Lua programming
- Processing XML with Lua
Guide 4 of 6 β Encoding complex textual variation in TEI
Previous: Encoding a basic critical apparatus in TEI Β· Collection overview Β· Glossary Β· Next: Processing TEI critical apparatus data with Lua