## Introduction to XML and TEI Part 1 --- Jeffrey C. Witt (Loyola University Maryland) ---

Basic Rules of XML

XML semantically identifies pieces of data using opening and closing tags which are enclosed with angle brackets.

<div>This is a division</div>

<div>This is a paragraph </div>

Tags cannot be cross-nested.

wrong

<div>Overlap is <emphasis>not allowed!</div></emphasis>

correct

<div>This is <emphasis>correct</emphasis></div>

Tags must be either siblings of another set of tags or children of a set of tags.

In XML talk, all tags are called 'elements'

In Aristotle talk, elements are like subjects that can take on differentiating accidents.

In addition to containing text and other elements, elements can take on "attributes".

<quote type="paraphrase">This a paraphrased quotation </quote>

<div type="articulus">This is an article division </div>

All elements must be contained inside one Root Element

The result of following these rules is a document whose content is nicely organized into a tree structure.

Where do the element names come from? How do we know what elements or tags we can use?

The X in XML stands for eXtensible

This means that XML actually doesn't specify any set of tags or element names. Anyone can make up their own set of elements and use them however they like.

Extensibility provides a lot flexibility

It allows different industries and fields to create tags that meet their needs and their data.

Extensibility can also cause confusion

If everyone can just make up their own tags, we can create confusion about what different tags mean and the datatypes they are encoding.

Someone might choose to tag something as <paragraph> and another person might to choose to tag something as <para> and a third person might choose <p>.

How do we avoid this confusion?

Enter TEI

TEI: a predefined set of elements designed by and for humanities scholars and textual editors

About TEI and the TEI Guidelines

The core structure of a TEI Document

<TEI>
<teiHeader>The place for information about the author, the editor, publisher, sources used, and other types of metadata</teiHeader>
<text>
<body> The place for division and paragraph elements and of course the text itself</body>
</text>
</TEI>

Creating a new TEI file with Oxygen

How to use the TEI templates

Adding to the TeiHeader

Adding text data

TO DO:

  • On a piece of scratch paper draw a page of your text, then draw boxes around all the distinct data types that appear on a page.
  • Make a list of the major data types in your text.
  • What TEI elements can you use identify these data types?
  • Start adding your text to the `body` element.

Using Oxygen: The go to XML editor

  • New file
  • Outline view
  • Custom Templates
  • Latin Dictionary
  • Project View
  • Basic conversions