Maintained by: David J. Birnbaum (djbpitt@gmail.com)
Last modified:
2021-03-30T23:17:44+0000
This test uses a poem from this semester’s Dickinson project, which you can find at schematron-instance.xml. We have modified the XML for use in this Schematron test, including introducing content and markup that was not present in the project data. The original developers are not responsible for these modifications, which were made only for testing purposes.
You may assume that Relax NG validation is ensuring that all required elements and
attributes are present and in allowed contexts. For example, you do not have to validate
that the document contains a <date>
, that the date is where it should
be in the document, that the date is a four-digit year, that the date is allowed to have
a @period
attribute, or that late
is a permitted value for that
attribute.
Create Schematron rules that enforce the following constraints:
<line>
element cannot begin or end with a space character.<line>
element cannot be empty or contain just whitespace.<stanza>
element with a @type
attribute that has
the value quatrainmust contain exactly four lines. Your error message should report the actual line count of stanzas that fail this test.
<date>
element that has a @period
attribute with the value latemust be dated between 1875 and 1886, inclusive. Your error message should report the actual date that appears in the poem.
<line>
elements also apply to all element descendants of the <metadata>
element. That is, none of those elements can begin or end with a space character and
they cannot be blank or consist entirely of whitespace. You should write one rule
that tests all of these elements, and not a separate rule for each of them.<poem_themes>
metadata element must
correspond to the name of at least one child element inside a
<line>
. For example, if there were a <theme>
element with the value obdurodon, there would have to be an element called
<obdurodon>
in a line of the poem.* No fair checking by specific
names; this rule has to work with any element type, including those not present in
this particular poem. Your error message should report the value of the spurious
<theme>
element.<line>
must have names that correspond to
<theme>
element children of the
<poem_themes>
metadata element. This is the mirror image of
the preceding rule, and your error message should report the name of the element
type that appears in the body but is not listed among the metadata themes.You should associate your schema with your XML document instance in <oXygen/> and verify that it works by changing some of the values to ensure that it raises errors when it should and does not raise errors when it shouldn’t. When you are satisfied with your answer, please upload just the Schematron file (not the XML) to Canvas.
* Poetry about Australian animals is not as rare one might think. Dante
Gabriel Rossetti and Christina Rossetti, sibling Pre-Raphaelite rock stars, both
published poems about wombats. See Angus Trumble’s
.O Uommibatto
How the Pre-Raphaelites became obsessed with the
wombat