TEI Structures


Elements are like nouns. They describe what a piece of text is.

Texts are made up of elements that usually have a start and end tag, very similar to HTML encoding in appearance.

What is different about XML encoding is that it generally describes content rather than appearance or display properties.

Elements are rendered within angle brackets, just like in HTML

<persName>George Washington</persName>
<title>The Idylls of the King</title>

Elements are Nested and Never Overlap

The encoded text consists of elements which contain other elements. The rules that you adopt determine what is allowable within each element.

<p>The father of our country is <persName>George Washington</persName>.</p>


<p>The father of our country is <persName>George Washington</p></persName>.

When Elements are Used to Describe Appearance, They Are Really Describing Content

When a piece of the text is in bold or italics, HTML encoding would describe it as <emph> or <i>. XML encoding would describe why it is rendered differently than the rest of the page.

HTML: <p>The title of the book is <i>The Idylls of the King</i>.</p>
XML: <p>The title of the book is <title>The Idylls of the King</title>.</p>

Then, you can use a stylesheet to render all titles in italics.


Attributes are like adjectives. They modify the elements. They cannot stand on their own. They can be used to provide a huge amount of information that does not appear in the text, and by encoding it in the attributes, it can be used for searching and analysis.

Example: <p><persName type="male">George Washington</persName> was the first president of the United States.</p>

Attributes are rendered as @attribute in writings about encoding.

Each element has a list of allowable attributes that you can adopt or discard when you are creating your rules.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License