Text Encoding Initiative (TEI)

repository·dev·Indexed 43 days ago

https://github.com/teic/tei

Source 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.

Tokens
24.2K
Snippets
26
Records
204
Agent score
56%

What's inside TEI

  1. Overview of the Text Encoding Initiative (TEI)

    dev
    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.
  2. SchXslt Schematron enhancements

    dev

    SchXslt supports several Schematron enhancements beyond the standard specification:

    • Typed variables: Supports the @as attribute 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 @rule attribute 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)
  3. How the TEI newsfeed is generated

    dev

    The TEI newsfeed is a multi-step process that transforms an Atom feed (hosted on Sourceforge via WordPress) into HTML components. The process involves:

    1. Fetching the Atom feed using a shell script.
    2. 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.

  4. Convert TEI P5 source to pure ODD using purify.sh

    dev

    The purify.sh shell 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:

    1. Create new dataSpec elements: Apply the purifyDataSpecs.xsl stylesheet to each existing data.foo file to create new dataSpec elements for all existing TEI datatype macros.
    2. Apply general conversions: Apply the purify.xsl stylesheet to each existing spec file, ensuring that existing dataspecs (both pure and impure) are excluded from this step.
    ./purify.sh
  5. Commit changes to your local repository

    dev

    Unlike Subversion, Git requires you to commit changes to your local repository before they can be pushed to a server. There are two primary workflows:

    1. Commit all tracked changes: Use the -a flag 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"
  6. Push local commits to GitHub

    dev

    To 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 dev

    Handling 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:

    1. Run git pull origin dev.
    2. Resolve any merge conflicts in the affected files.
    3. Stage the resolved files (git add <file>) and commit them.
    4. Run git push origin dev again.
  7. How to work on the TEI P5 Guidelines

    dev
    If your goal is to contribute to or modify the TEI P5 Guidelines, you should focus your work within the P5 directory of this repository. The repository contains the sources for both the Guidelines and the schemas used for customization.
  8. Fetch and validate the TEI Atom feed with wget-news.sh

    dev

    To 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.sh
  9. Install SchXslt

    dev

    SchXslt 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 package
  10. Transform Atom feed to HTML using XSLT

    dev

    Once the Atom feed is retrieved, use the following XSLT stylesheets to generate the newsfeed HTML files:

    • To create news-headlines.html: Use atom2HTML-headlines.xsl.
    • To create news-body.html: Use atom2TEInews.xsl.

    Note: The transformation may require htmlparse.xsl (David Carlisle's implementation) to correctly handle CDATA escaped sections within the feed.