ISO Schematron

Schematron is a rule-based validation language to specify validation processes against XML documents. ISO Schematron is an ISO (ISO/IEC 19757-3:2006) and open standard. Please visit the ISO Schematron web-site for the technical specification and details.

ESPD Business Rules

The ESPD-EDM uses Schematron to validate business rules, the business requirements taken as input for these rules are specified in the ESPDint Business Document.

These business rules can be typified as:

  1. Semantic validations: e.g. The "cac:TenderingCriterionResponse" in a Response document MUST match one, and only one, of the "cac:TenderingCriterionProperty" elements in the XML instance of the corresponding ESPD-Request;

  2. Assertions about the presence or absence of patterns in XML documents: e.g. all business rules that apply to identifier nodes: mandatory attributes, structure of the identifier, etc.;

  3. Code lists validations: e.g. values and attributes for each code list element;

  4. Other validations that an XSD cannot do: e.g. Validates that one of the nodes has at least 1 child.

The following image shows different examples of validations:

Non-code list business rules

The validation of code lists is explained in sections below.

Schematron Architecture

ISO Schematron executes the validations in two stages:

  1. Design and implementation of the SCH files. SCH stands for Schematron Schema and contains the set of rules to be validated within the XML document.

  2. Execution of the implemented validations in the SCH files:

    1. Transformation of SCH files into XSLT files in order to be able to execute the validations against the XML.

    2. Execution of the validations using the XSLT files to get the final report.

Architecture for non-code list validation

What does the SCH file contain?

  1. Set of rules specifying the context (the element(s) and/or attribute(s) which the assertions affect);

  2. Each rule have a set of assertions with the tests that must be evaluated in the context.

SCH file example

Execution

As a basis of the implementation, it has been taken into account:

  1. Schematron "skeleton" implementation in XSLT.

Execution files

This example describes the execution of the validation process using the Saxon library to execute XSLT files and the XSLT provided as a basis:

Execution of the validation process