DToC requires XPath information to upload original XML documents. These may changes
depending on how you have structured your document. The below information is for a XML
document that follows the template structure, but we have noted how you can change the XPath
information to match your document.
-
Open up the settings in the homepage of DToC. This option is represented by a
gear in the top right corner of the “Add Text” box.
-
Change the “Input Format” to TEI.
-
Enter this XPath information into the corresponding areas (in the info section
below).
- XPath to
Content: *
- XPath to
Author: //*[local-name()='head']//*[local-name()='author']
- XPath to
Title: //*[local-name()='head']//*[local-name()='title']
- XPath to
Documents: //*[local-name()='div'
and('chapter'=@*[local-name()='type'] or
'forward'=@*[local-name()='type'] or
'index'=@*[local-name()='type'])]
DToC splits the XML into "documents" based on XPath criteria that is
provided when importing the file into DToC. The "XPath to document" section
assumes that your document is organized into chapter(s), a forward, and an
index. You may have to configure the XPath to document section if your document
has additional structure components (such as an afterword).
Each chapter
should have author and title info. When importing, you can provide XPaths to
these values, relative to the parent chapter.
To add an after word, you
would need to add this expression to the larger
chain:
‘afterword’=@*[local-name()=’type’]
The XPath to Documents
chain would now look like:
//*[local-name()='div'
and('chapter'=@*[local-name()='type'] or 'forward'=@*[local-name()='type']
or ‘afterword’=@*[local-name()=’type’] or
'index'=@*[local-name()='type'])]
For more information on XPaths see
http://www.w3schools.com/xsl/xpath_intro.asp
- Optional:
Click "OK".
- Optional:
Click on the “Upload” button in the lower right corner.
- Optional:
A popup appears. Click on the “Add” option at the top of the popup.
- Optional:
Select the XML document on your computer that you would like to upload to DToC.
If you accidentally uploaded the wrong document click on the left icon (the
red delete symbol) and upload the correct document. Or you can upload more than
one document, but only one with be “Revealed.”
- Optional:
Once the document appears in the upload popup, click on “Reveal.” Voyant will
process your document. Once it is finished processing your document, DToC will
open with your XML document uploaded.