This is a tutorial for learning how to customize schemas using the “chain” feature of TEI ODD.
What is ODD Chain#
There are two approaches to ODD chaining:
1. Inheritance (Vertical Chain)#
References a parent ODD using the source attribute to inherit customizations.
2. Combination (Horizontal Chain)#
Uses specGrp and specGrpRef to integrate multiple ODDs.
Folder Structure#
Prerequisites#
- Saxon (XSLT 2.0 processor)
- TEI Stylesheets (installed at
../scripts/Stylesheets)
Build Method#
Generated Files#
| Source ODD | RNG | HTML |
|---|
| 01-inheritance/base.odd | output/base.rng | output/base.html |
| 01-inheritance/derived.odd | output/derived.rng | output/derived.html |
| 02-chain/main.odd (after integration) | output/combined.rng | output/combined.html |
Description of Each File#
01-inheritance (Inheritance Type)#
base.odd#
The base ODD. Contains minimal modules and basic customizations.
derived.odd#
A derived ODD that inherits from the TEI standard and adds additional customizations.
02-chain (Combination Type)#
Defines header-related customizations with specGrp.
text-specs.odd#
Defines body-related customizations with specGrp.
main.odd#
Integrates multiple ODDs by referencing them with specGrpRef.
Processing Flow#
Inheritance Type#
Combination Type#
XSLTs Used#
| XSLT | Location | Role |
|---|
| odd2odd.xsl | Stylesheets/odds/ | ODD compilation (module expansion, inheritance resolution) |
| odd2relax.xsl | Stylesheets/odds/ | RelaxNG schema generation |
| odd2html.xsl | Stylesheets/odds/ | HTML documentation generation |
| merge-specs.xsl | 02-chain/ | specGrpRef expansion (custom-made) |
References#