Skip to Main Content
It looks like you're using Internet Explorer 11 or older. This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge. If you continue with this browser, you may see unexpected results.

University Library, University of Illinois at Urbana-Champaign

An Introduction to XML and TEI

This guide provides an introduction to XML and the Text Encoding Initiative.

Validating Your Document

A valid XML document is one that conforms to the rules of its schema. oXygen makes it easy to verify that your document is valid and to fix problems with an invalid document. 

In the upper right corner of the main window in Oxygen, a box indicates the validity of your XML document.  A red box means that it is not valid, and a green box indicates that your document is valid.

In this example, the document is not valid because it has an ampersand ("Chapman & Hall"), and XML documents cannot include these.

The box in the upper-right hand corner of the editing screen will be red, and a mark in the vertical scrollbar will show you what part of the document makes it invalid.

Several marginal notes have been made to flag errors in the TEI document. (1) “This document is not valid because it incorporates an ‘&’ sign—a special character that can’t appear on its own.” (2) “When a document is not valid, this box will be red” (an arrow points to a box at the top right of the editing field). (3) “A mark will appear in the margin telling you where the problem is, and an explanation will appear under the XML document.”

Images courtesy of University of Michigan Library.

When we correct the error (by changing the ampersand to the Unicode "&"), the document becomes valid.