Digital humanities


Maintained by: David J. Birnbaum (djbpitt@gmail.com) [Creative Commons BY-NC-SA 3.0 Unported License] Last modified: 2019-03-08T16:49:57+0000


Test #5: Schematron

The text

This test uses the text from Agatha Christie's novel The murder on the inks, which you’ll find on the Project Gutenburg project. You can download our XML version of this file at http://dh.obdurodon.org/schematron-test-christie.xml.

This document has a root element <book> with two main child elements, <toc> for the table of contents and <text> for the body of the text. In the table of contents, there are <chapter> elements that contain the chapter title as text and that have an @n attribute containing the chapter number. The body element also contains <chapter> child elements with @n attributes, and the chapter titles for these chapters are contained a child element of <chapter> called <ch-title>. Pause now and look at that markup to see how chapters and chapter numbers are represented in the table of contents and in the main body.

The task

Your task is to write a Schematron schema that will validate that chapter numbers (the values of the @n attribute) in both the table of contents and the body begin with 1 and run consecutively through the body. You’ll also need to validate that the table of contents and the body have the same number of chapters.

You should associate your schema with your XML document instance in <oXygen/> and verify that it works by changing some of the values in the table of contents and in the body in the XML. When you are satisfied with your answer, please upload just the Schematron file (not the XML) to Courseweb.