Text Encoding Initiative (TEI)
repository·dev·Indexed 43 days ago
https://github.com/teic/teiSource materials for building the TEI P5 Guidelines and associated schemas, which are international standards for representing literary and linguistic texts. Includes documentation on converting P5 source to pure ODD, using SchXslt for validation, and release notes for versions 0.4.1, 1.0.1, and 1.3.
What's inside TEI
- The TEI is an international, interdisciplinary standard used by libraries, museums, publishers, and academics to represent literary and linguistic texts. It uses an encoding scheme designed to be maximally expressive and minimally obsolescent. This repository provides the source files required to build the TEI P5 Guidelines and TEI schemas.
SchXslt Schematron enhancements
devSchXslt supports several Schematron enhancements beyond the standard specification:
- Typed variables: Supports the
@asattribute on variable declarations to annotate expected types (useful for XSLT 3.0). - Global abstract rules: Introduces a top-level
<rules>element to hold abstract rules that can be globally referenced via the@ruleattribute of an<extends>element. - Additional XSLT elements: Allows the use of several XSLT elements within a Schematron schema to set up the query environment, including:
xsl:accumulator(XSLT 3.0)xsl:import(XSLT 1.0, 2.0, 3.0)xsl:import-schema(XSLT 2.0, 3.0)xsl:include(XSLT 1.0, 2.0, 3.0)xsl:use-package(XSLT 3.0)
- Typed variables: Supports the
How the TEI newsfeed is generated
devThe TEI newsfeed is a multi-step process that transforms an Atom feed (hosted on Sourceforge via WordPress) into HTML components. The process involves:
- Fetching the Atom feed using a shell script.
- Transforming the Atom feed into two distinct HTML files using XSLT:
news-headlines.html: A summary/headline view.news-body.html: A detailed body view.
The transformation relies on XSLT stylesheets to parse the Atom XML and extract content.
Convert TEI P5 source to pure ODD using purify.sh
devThe
purify.shshell script automates the bulk of the conversion process to transition TEI P5 source to use "pure ODD". The process is semi-automatic and involves two main stages using XSLT stylesheets:- Create new dataSpec elements: Apply the
purifyDataSpecs.xslstylesheet to each existingdata.foofile to create newdataSpecelements for all existing TEI datatype macros. - Apply general conversions: Apply the
purify.xslstylesheet to each existing spec file, ensuring that existing dataspecs (both pure and impure) are excluded from this step.
./purify.sh- Create new dataSpec elements: Apply the
Commit changes to your local repository
devUnlike Subversion, Git requires you to commit changes to your local repository before they can be pushed to a server. There are two primary workflows:
- Commit all tracked changes: Use the
-aflag to automatically stage all modified files.git commit -am "My helpful commit message"
2. **Stage specific files first:** If you have new files or want to commit only specific changes, use `git add` first. ```bash git add filename.xml git commit -m "My message"git commit -am "My helpful commit message" # OR git add filename.xml git commit -m "My message"- Commit all tracked changes: Use the
Get started with TEI P5
devA draft tutorial titled "Getting started with P5" is available for users looking to begin working with the TEI P5 schema.
Note: This refers to the draft tutorial located at the URL below.
http://www.tei-c.org/Drafts/edw88.xmlPush local commits to GitHub
devTo send your locally committed changes to the remote server, use
git push. You must specify the remote (origin) and the branch (dev).git push origin devHandling Out-of-Sync Errors: If the push is rejected because someone else has pushed changes to GitHub, you must first pull those changes to merge them into your local copy:
- Run
git pull origin dev. - Resolve any merge conflicts in the affected files.
- Stage the resolved files (
git add <file>) and commit them. - Run
git push origin devagain.
- Run
How to work on the TEI P5 Guidelines
devIf your goal is to contribute to or modify the TEI P5 Guidelines, you should focus your work within theP5directory of this repository. The repository contains the sources for both the Guidelines and the schemas used for customization.Fetch and validate the TEI Atom feed with wget-news.sh
devTo retrieve the latest Atom feed from Sourceforge and ensure it is well-formed, use the provided shell script
wget-news.sh. This script automates the downloading process and performs basic validation on the resulting XML../wget-news.shInstall SchXslt
devSchXslt can be installed in several ways depending on your environment:
- XSLT Stylesheets only: Download the ZIP file from the GitHub releases page. This is the simplest method for direct XSLT usage.
- Java (Maven): Use the Maven dependency to include it in your Java project.
- XML Databases: Download installable XQuery modules for BaseX or eXist from the release page.
- Build from source: Clone the repository and use Maven to create custom packages.
# To build from source git clone --recursive https://github.com/schxslt/schxslt.git cd schxslt mvn packageAccess TEI P5 packaged releases
devPackaged releases of TEI P5 can be downloaded from the TEI SourceForge site.
Note: This release note refers to version 0.1.9.
http://tei.sf.netTransform Atom feed to HTML using XSLT
devOnce the Atom feed is retrieved, use the following XSLT stylesheets to generate the newsfeed HTML files:
- To create
news-headlines.html: Useatom2HTML-headlines.xsl. - To create
news-body.html: Useatom2TEInews.xsl.
Note: The transformation may require
htmlparse.xsl(David Carlisle's implementation) to correctly handle CDATA escaped sections within the feed.- To create