The pattern is "hardcoded" to validate XML instance documents that have a
root element whose name is "Document," each child element has the name "Para,"
and each element has an attribute with the name "classification," e.g.
Organization-XYZ.xml
Other XML instance documents may have the same pattern - a security label on the root element
and a security label on each child element - but use a different name for the root element,
a different name for the child elements, and a different name for the attribute, e.g.
Organization-ABC.xml
Motivation for Abstract Patterns
Schematron abstract patterns enable us to express patterns in a way that is independent
of specific tag and attribute names.
How to Create an Abstract Pattern
On a pattern element add an attribute, abstract="true"
On each rule use a "parameter reference" for the value of the context attribute. (A parameter reference
looks like a variable)
On each assertion use a parameter reference for the value of the test attribute.
Science is all about identifying patterns, and representing the patterns abstractly.
Abstract representations allow us to contemplate the properties of a whole class of things,
rather than treating each thing on a case-by-case basis.
For example, long ago people noticed that then an object is lifted and then released,
it falls down to earth. It doesn't matter whether the object is a rock, or a feather, or
anything else. All objects exhibit the same pattern of behavior.
Information Patterns!
The abstract patterns in Schematron challenge us to become information scientists:
identify patterns in information, create an abstract representation of the pattern,
and then for each instance relate it to the abstract represenation.
Put Abstract Pattern in a Separate File
An abstract pattern has greatest value when it is used by multiple schemas.
So let's move it into a separate file, where it can be included by other schemas.