XML technologies / Schematron / Schematron introduction / Schematron exercise

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 to top