Schematroll, the Schematron mascotMeet Schematroll, the Schematron mascot! Schematroll is a cross between a bilby and a bettong.


Before beginning this assignment, please thoroughly read our introduction to Schematron. This tutorial will be useful to you during this assignment and the Schematron Exercise 2. To begin this assignment, you will need to open a new Schematron document in <oXygen/> under File → New → New Document → (scroll to Schematron in the alphabetized list) → Schematron. Once opened, you will keep the default xml line at the top, but you will delete everything from <sch:schema> down. You will then replace this with:

<schema xmlns:sch="" queryBinding="xslt2"

You will be writing your Schematron inside the <schema> root element.

Analysis of the task


The Banksy project team is coding <location> elements indicating where in the world Banksy artwork was made. Sometimes there are errors in their recording of latitude and longitude attributes that are hard to spot in the code and cannot really be captured with their Relax NG schema. We found one of these errors (at an early stage of the project) by browsing the map on their website and selecting an artwork that looked to be in Japan, and turned out to really be made in Melbourne, Australia.

The Banksy file in that is mapped in Japan when it should be in Australia (at that early stage in the project) was coins_change.xml, which you should inspect as posted in for this exercise on DHClass-Hub. Access the file here and pull it in or download it to work with in this exercise. Open the file in oXygen. Take a close look at the encoding for the <location> element and its @lat and @long attributes.

<location lat="37.8136" long="144.9631">Melbourne, AU</location>

A crash course in geocoding may be in order to understand the issue: Latitude measurements indicate how far north or south of the equator a location is. Longitude measurements tell you how far east or west of the Prime Meridian (in Greenwich near London, England) a location is. Here’s a handy explanation of these concepts with visuals. The problem with the encoding in the coins_change.xml file is that it is positioning the location north of the equator by using a positive number. From this example, we can see where errors can easily occur in coding either the @lat or @long attributes on the Banksy project.

The task:

Your task is to write a Schematron file and create a Schematron pattern to deal with location geocoding problems. Inside the pattern, construct some rules with the context set on the location element.

For the purposes of this assignment, we will ask you to work with coins_change.xml we've been looking at, as well as looting_soldier.xml in the Banksy collection, each of which is misplaced for either the @lat or @long attribute.

  1. Write Schematron rules to make sure that a location marked in "AU" (whose text node contains "AU") must have a longitude reading that is in the far east of the Prime Meridian (a value greater than 100), and must have a positive value, greater than zero, and that the latitude reading must be less than zero (or have a negative value) to place it in the eastern and southern hemispheres.
  2. Write a Schematron rule to make sure that a location marked in the USA must have a longitude reading that is west of the Prime Meridian (a value less than zero, or a negative number), and that the latitude reading must have a positive value, greater than zero to place it in the western and northern hemispheres.


Upload your completed Schematron schema and your re-created XML document (with your associated Schematron line) on Courseweb. Please follow our standard filenaming conventions for homework assignments uploaded to Courseweb.