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 fully take advantage of DToC.
If you would like to follow along with these instructions you can download a template
here: http://cwrc.ca/templates/DToC_Document_Template.xml
You can open this template in oXygen, TextEdit, TextWrangler, etc.
-
Open an application that allows you to create an XML document (oXygen,
TextWrangler, Textedit, etc.). Our documentation here uses the Oxygen XML editor
http://www.oxygenxml.com/
-
Enter the XML declaration and TEI P5 schema definition
-
Add informations to your TEI header.
The TEI Header helps you to define the title, publication information, and
source information about the document you are working on.
-
In the body section of your document, wrap div tags around each of your
chapters (or sections that you want 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 then the chapters
will blur together into one section of text. All the div tags in the template
are predefined with "type='chapter'.
-
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 Content and at the top
of the text column depending on what chapter is being examined.
-
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. If you
would like to add additional chapters, see below. For more information about
adding an index see the “Adding an index” linked below.
- 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.
- 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.