Info

Title CETEIcean, a JavaScript library for isomorphic TEI to HTML transformation
responsible

Encoded by   Vanessa Hannesschläger

Encoded by   Daniel Schopper

License

The Creative Commons Attribution 4.0 International (CC BY 4.0) License applies to this text.

Abstract

This demonstration will introduce CETEIcean, a JavaScript library for displaying TEI in a web browser. Instead of sticking with the semantically poor element set of HTML, CETEIcean reframes an isomorphic transformation of TEI as HTML, by registering modified TEI elements with the browser using the new Custom Elements technology1. This is a new feature that does not yet work in all browsers, but CETEIcean supports older browsers too.

Typical TEI workflows first mark up text and then transform it into a variety of formats for digital publication, which is particularly useful where multiple outputs are desired. Converting TEI to HTML is the most common and most practical way of publishing TEI texts on the web, but HTML lacks what TEI has: a very well-considered and mature set of semantic tags for encoding texts. When converting TEI to HTML, the semantic distinctions in the markup are often lost in favor of typographic distinctions in the display. In other words, the data model represented in the TEI fails to carry over to the online version.

The solution is to preserve the semantics of the TEI source. Various ways of doing this have been proposed. These include the imposition of TEI semantics onto HTML elements using RDFa or microformat, and (more practically) the use of an in-browser XSLT transformation to wrap the TEI document in an HTML envelope and make it able to be styled with CSS and JavaScript2. CETEIcean’s approach is inspired by Boilerplate, but it is based on web standards and is more flexible. It does not require an in-browser XSLT step, nor any modification to the source XML; TEI content can be loaded in the browser via an AJAX call, or via server-side processing. A Boilerplate-style XSLT transform directive could be used too.