Lesson 1.3: Getting Started with TEI Encoding
Introduction
This lesson outlines the essential tools and setup required to create valid TEI-XML documents, including choosing an appropriate editor, configuring schema support, and validating encoded files.
Choosing a TEI-Compatible Editor
To begin encoding with TEI, an XML-capable text editor is essential. Editors come in two main forms: desktop-based (installed on a local computer) and web-based (used through a browser without installation). Web-based tools often support ease of access and real-time collaboration, while desktop editors offer deeper customization, offline access, and advanced features.
Options range from professional tools like oXygen to open-source and browser-based environments that support collaboration, validation, and customization. The table below compares leading editors across key criteria, helping users choose a setup that fits their technical level, project goals, and collaborative needs.
Editor | Cost | Schema Support | Validation | Ease of Use | Collaboration Features | Best For |
---|---|---|---|---|---|---|
oXygen XML Editor | Starting from $240 Academic licenses $6/month Free Trial |
Full TEI P5 support (RNG, DTD, XSD); TEI templates included | Built-in validator; schema-aware auto-completion | Intermediate to advanced | Can integrate with Git, SVN, or Oxygen XML Web Author for shared editing | Comprehensive professional TEI projects; advanced encoding and collaboration |
oXygen XML Web Author | Starting from $672/month Free Trial |
Same as desktop version | Real-time schema validation in browser | Beginner-friendly UI; visual and raw XML views | Real-time collaboration; comments; version history | Collaborative classroom or team-based encoding |
XML Copy Editor | Free, open source | Supports DTD and Relax NG | Manual validation; less intuitive than oXygen | Intermediate | None (no built-in sharing or version control) | Offline personal projects or teaching simple schemas |
Visual Studio Code with XML Tools + TEI plugins | Free, open source | Supports DTD, RNG via plugins (e.g., Red Hat XML extension) | External extension configuration | Moderate (requires setup) | Git-based collaboration; GitHub Codespaces or Live Share | Teams with developer experience; adaptable to classroom collaboration |
TEI Publisher | Free (web-based) | TEI P5 and TEI Simple supported | Not built for editing — view-only | Easy for beginners to view structure and output | None | Designing or customizing TEI schemas; teaching markup structure; creating project-specific encoding frameworks |
Roma TEI | Free (web-based) | Full TEI P5 support; generates custom ODD schemas | Indirect (generates schemas for validation in other tools) | Easy to moderate (form-based interface, but concepts may be new to beginners) | None | Schema customization; teaching structure and publishing output; not for encoding |
Sublime Text | $70 Free Trial |
With external XML plugins only | Limited support; setup required | Fast and minimalist | Git integration possible (via plugins); not designed for live collaboration | Lightweight editing for experienced users |
At a Glance
- Best for beginners: oXygen XML Editor (desktop) or TEI Simple Publisher (if viewing structure only).
- Best collaborative option: TEI Publisher or oXygen XML Web Author for real-time TEI projects.
- Low-cost, team-friendly alternative: VS Code + GitHub — great for remote teams and users who prefer customizable, open-source tools and are comfortable using version control systems.
Schema Selection
TEI documents follow strict XML rules, enforced by schemas. A schema is a set of rules that define the structure, elements, and attributes allowed in a TEI document, ensuring consistency and correctness. Schemas serve as a blueprint that helps maintain interoperability between different TEI-encoded texts and ensures adherence to TEI standards. They also enable automatic validation, helping users detect errors in their XML structure. TEI schemas come in different formats, such as Relax NG (preferred for TEI), DTD, and XSD (see table below).
However, as the TEI Guidelines point out, it is important to remember that every schema results from an interpretation of a text
and that there is no single schema encompassing the absolute truth about any text, although it may be convenient to privilege some schemas above others for particular types of analysis.
Schema Type | Full Name | Description | Usage |
---|---|---|---|
Relax NG | Regular Language for XML Next Generation | A modern, compact, and flexible schema format. Can be written in XML or in a more readable compact syntax | The default and recommended schema type for TEI validation and customization |
XSD | XML Schema Definition | More complex and formal. Often used in enterprise or government XML applications | Supported in TEI but less commonly used than Relax NG. Useful for interoperability with tools that require it |
DTD | Document Type Definition | The oldest schema language for XML. Simple and widely supported, but limited in flexibility | Still supported by TEI but gradually being phased out for more powerful options |
Setting Up Your Editor for TEI
Once you’ve chosen an editor, follow these steps to set up your workspace for TEI encoding:
1. Installing TEI Schemas
To ensure your encoding is correct, install the TEI schema in your editor:
- Oxygen XML Editor: Go to Options > Preferences > Document Type Association, then Add TEI.
- Visual Studio Code: Install the XML Language Support by Red Hat extension by navigating to the Extensions Marketplace (Ctrl + Shift + X), searching for "XML Language Support by Red Hat," and clicking "Install." This extension provides TEI schema validation, XML formatting, and auto-completion to assist with structured encoding. Once installed, you can configure TEI schemas in your workspace settings.
- Roma: A web-based tool that allows users to customize TEI schemas by selecting specific modules relevant to their projects. Users can generate custom ODD (One Document Does-it-all) schemas tailored to their needs. Access Roma here: Roma TEI.
- Download TEI schemas from TEI Guidelines.
2. Enabling XML Validation
Always check for well-formed XML before encoding complex texts. Common errors are mismatched tags, missing attributes, incorrect nesting. Validation ensures that the document adheres to XML syntax rules.
- Oxygen XML Editor: Press Ctrl + Shift + V to validate your TEI document.
- Visual Studio Code: Install the XML Tools extension for automatic validation. You can download it from the Visual Studio Marketplace. Relax NG schemas, commonly used for TEI validation, can also be enabled to ensure that TEI-encoded texts adhere to standard guidelines.
- Roma: Roma allows users to validate TEI-encoded texts by applying TEI schemas directly in a web-based interface. Users can upload a TEI file or paste their text, and Roma will check it against the selected schema to ensure proper encoding and compliance with TEI standards.

Works Cited
- TEI Consortium. A Gentle Introduction to XML. TEI: Guidelines for Electronic Text Encoding and Interchange, TEI Consortium, 2025, tei-c.org/release/doc/tei-p5-doc/en/html/SG.html. Accessed February 20, 2025.
- University of Illinois. An Introduction to XML and TEI. University Library LibGuides, 8 Nov. 2023, guides.library.illinois.edu/xml/oxygen. Accessed May 2, 2025.