tei-xml

Encode historical documents as TEI P5 XML with scholarly metadata and apparatus.

33|6|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill tei-xml
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tei-xml
Source: https://github.com/xjtulyc/awesome-rosetta-skills/tree/main/skills/13-history/tei-xml
Command: npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill tei-xml

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lxml, beautifulsoup4, pandas.

What problem does it solve?

This Skill helps you turn historical materials into standardized TEI P5 XML so you can add scholarly metadata, represent manuscript witnesses and variant readings, and reliably query and transform the result for digital editions and downstream analysis.

Core Features & Use Cases

  • Build TEI P5 edition structure: generate a TEI document with a teiHeader (fileDesc, encodingDesc, profileDesc) and a text body with divisions and paragraphs.
  • Model historical scholarship in XML: encode critical apparatus using app/lem/rdg and mark named entities with persName/placeName/orgName plus authority links (e.g., VIAF).
  • Query and transform for analysis and publishing: run XPath queries with lxml to extract named entities and frequency tables, extract apparatus tables, produce plain text, and transform TEI with XSLT/Saxon-HE for HTML or other formats.
  • Use Case: You have a corpus of Latin manuscripts and want an AI-assisted pipeline that builds TEI, links persons and places to authority URIs, extracts entity frequency per document, and exports clean plain text for NLP.

Quick Start

Use the tei-xml skill to encode your historical text as TEI P5, link persName/placeName to VIAF or Wikidata URIs, extract named-entity frequency tables with XPath, and transform the TEI into plain text or HTML-ready output.

Frequently Asked Questions about tei-xml

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I encode historical manuscripts as TEI P5 XML for digital editions?

To encode historical manuscripts as TEI P5 XML, structure your document with a teiHeader containing fileDesc, encodingDesc, and profileDesc, then build the text body with divisions and paragraphs to create a standardized scholarly edition.

How do I model critical apparatus variants and named entities in TEI XML?

Model critical apparatus variants in TEI XML using app, lem, and rdg elements for witness readings, and mark named entities with persName, placeName, and orgName, supporting authority linking via VIAF or Wikidata URIs using the @ref attribute.

Can I use lxml to extract named entities and apparatus tables from TEI documents?

Yes, you can use lxml for namespace-aware XPath queries to extract named entities and generate frequency tables from TEI documents, while pandas structures the extracted apparatus data into clean tabular outputs for downstream analysis.

Does TEI XML transformation to HTML require XSLT with Saxon-HE?

TEI XML transformation to HTML can optionally use XSLT with Saxon-HE, or you can extract plain text directly for NLP tasks, providing flexible publishing and analysis pipelines without strictly requiring Saxon-HE for every output format.

What's the best way to link TEI encoded persons and places to authority files?

The best way to link TEI encoded persons and places to authority files is using the @ref attribute on persName, placeName, and orgName elements to connect to VIAF or Wikidata URIs for reliable entity identification.

Why use TEI P5 XML over plain text for historical document corpora?

Use TEI P5 XML over plain text because it captures scholarly metadata, represents manuscript witnesses and variant readings in a critical apparatus, and enables reliable XPath querying and XSLT transformation for digital editions and downstream analysis.