Schematron: The complete course


Detailed technical coverage of ISO Schematron. It covers all of the major features of Schematron, including design considerations and best practices. Numerous hands-on exercises are used to reinforce the lessons.


2-3 days


To schedule a class, please contact us at

Topics covered

  1. Schematron: An overview
    • What is Schematron?
    • Comparison with other schema languages
    • A simple Schematron example
  2. Schematron basics
    • Patterns
    • Rules
    • Assertions and reports
  3. XPath expressions
    • Axes
    • Node tests
    • Predicates
  4. XPath functions and operators
    • Built-in functions: An overview
    • Comparison operators
    • Boolean operators
    • Arithmetic operators
    • Conditional expressions
    • Quantified expressions
  5. Typical Assertions
    • Checking for a particular value
    • Checking for existence
    • Checking for emptiness
    • Checking for a particular data type
    • Checking contents based on the value of an attribute
    • If one exists, the other must exist
    • If one exists, the other must not exist
  6. Typical Contexts
    • A particular element or attribute
    • An element or attribute with a given parent
    • An element or attribute with a given child
    • An element or attribute with a given value
    • Combining multiple contexts
  7. Structuring your schema
    • Separate patterns
    • Distributing rules within patterns
    • Distributing assertions/reports within rules
    • Assert vs. report
    • Using include
    • Best practices
  8. Dealing with namespaces
    • Declaring namespaces
    • Referencing qualified names
  9. Using variables
    • The let element
    • Referencing variables
    • Variables and scope
  10. Error messages and diagnostics
    • Writing useful error messages with value-of and name
    • Using diagnostics
    • Enhancing output using icon, fpi, see
    • Further explaining using role and subject
    • Structuring and styling output using p, span and title
  11. Phases
  12. Abstract patterns
    • Abstract patterns
    • Using parameters
    • The extends element
  13. Generating useful output
    • Understanding SVRL
    • Writing tools to generate reports from SVRL