Your First TEI Document (in 10 minutes or less)
What you will need to do first:
What are the files you will need to create or have on hand to make it work?
- DTD or Schema: a file or set of files define the rules for your xml file.
We’ll be using the TEI P5 “TEI Lite” schema found in OxygenXML.
- Your xml file.
We’ll create a new one marked up following the rules in the TEI Lite Schema.
- Parser: checks the XML file for conformity.
We’ll use the RelaxNG schema for the “lite” version of the TEI P5. You’ll find it in OxygenXML’s Frameworks/TEI folder.
- Stylesheet(s): defines how file will be displayed or used.
We’ll use a stylesheet in OxygenXML that will transform the TEI document into an XHTML file (web page).
What’s in an xml file? What does it look like?
- It will start with a declaration, like this, that tells the parser that this is an xml file:
<?xml version="1.0" encoding="UTF-8"?>
- It may have a Processing Instruction. This sample indicates that a stylesheet will be used:
<?xml-stylesheet type="text/xsl" href="xhtml/tei.xsl"?>
- It
will have a root element, in this case TEI. There is also a namespace
indicating that all elements in this document are defined at the
authoritative source given.
<TEI xmlns="http://www.tei-c.org/ns/1.0">
- It will have elements, like this paragraph element with a number attribute:
<p n=”1”>This is a paragraph that I have decided to number as 1.</p>
Is there a simple screencast?
What’s Next?
- Read
more about the TEI at the Guidelines site listed above. I’d start with
a quick look at the TeiHeader section, then browse through the Elements
appendix, then read the appropriate sections for details and examples
for how to use the elements.
- Learn more about XSLT (stylesheets and transformations) at http://w3schools.com
Copyright Hope Greenberg. 26 Januaey 2011. Use with caution!