Exercise – Schematron for Noah's Ark

The Schematron elements presented so far are now sufficient to create a complete Schematron schema for the Ark. However, for this purpose we need further business rules. Together with the already known rules, they serve as an exercise for the implementation into a Schematron schema:


1. An animal must not exceed the species-specific reproduction age.
2. The maximum loading capacity of the Ark must not be exceeded.
3. Herbivores and carnivores must not be accommadated in the same room.
4. A carnivorous animal shall be no more than twice as heavy as its rommates.
5. A herbivorous animal shall be no more than ten times as heavy as its roommates.
6. Exactly one pair of each species has to be accommodated on the Ark.
7. The pair must also be accommodated in the same room.
8. A pair must always consist of a male and a female.
9. In each room no more than six animals shall be accommodated.


Create a suitable schema and test it with the oXygen editor. In addition, generate a valid sample instance containing the appropriate errors.

>> to the solution

Illustrations by Mehrdad Zaeri

<< back next >>




Copyright © dpunkt.verlag GmbH 2011
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "Schematron - Effiziente Business Rules für XML-Dokumente" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

dpunkt.verlag GmbH, Ringstraße 19B, 69115 Heidelberg, fon 06221-14830, fax 06221-148399, hallo(at)dpunkt.de