Creating an XML document for the Dynamic Table of Contexts

In the Dynamic Table of Contexts (DToC) users can upload their own XML text. These XML documents need to be specially formatted in order to experience the full range of capabilities provided by DToC.

If you would like to follow along with these instructions you can download a template here:

You can open this template in oXygen, TextEdit, TextWrangler, etc.

  1. Open an application that allows you to create an XML document (oXygen, TextWrangler, Textedit, etc.). The documentation presented here uses the Oxygen XML editor
  2. Enter the XML declaration and TEI P5 schema definition

  3. Add the necessary information to your TEI header.
    The TEI Header allows you to define the title, publication information, and source information about the document you are working on.
  4. The <div> element is used to divide the corpus into sections or chapters. In the body section of your document, wrap div tags around each of your chapters, or sections, that are to be separately itemized within the Table of Contents. These <div> tags should include a ‘type’ attribute with the value of ‘chapter’ <div type='chapter'>
    You define the div tags into chapters so that the different chapters will appear in the Table of Contents feature in the DToC (see images below). This is optional; if you don’t have multiple chapters you don't need this option. However, if you do and do not include this ‘type’ attribute, the chapters will blur together into one text without any distinct separations between your sections. All the div tags in the template are predefined with "type='chapter'.

  5. At the top of each chapter div, add the chapter’s author and title information (see image above).

    We have used TEI’s "head" tag to distinguish the headers from the body text; we have also wrapped it in a bibliographic element. This ensures that any information in a "head" tag will appear in the Table of Contents, as well as at the top of the Reading Pane, depending on which chapter is being examined.

  6. Begin marking up your document. Here is an example of a simple XML document that DToC will accept.

    This document only has one chapter associated with it and no index. For more information about adding an index, see the “Adding an index” linked below.
  7. Optional: If you would like to add additional chapters, copy the tags and text between and including the <div> tags and paste that information below the last <div> tag, then begin to fill in the information for your next chapter.

  8. Optional: You can now continue to mark up your text with XML tags (e.g. event, place, organization, etc.). These tags will appear in the Tags column on the left side of the DToC tool.