A language for making assertions about the presence or absence of patterns in linked XML documents, and reporting them in useful ways.
ISO Schematron 2025 is here!
The fourth edition of the ISO Schematron standard has now been published, twenty years after the first edition. Congratulations to editor Andrew Sales and all those involved, including Tony Graham and David Maus. The schemas are public and available on GitHub.
The edition's release note gives the main changes as:
- a query language binding has been added for XQuery3
- (actually for XSL3.1 and XQuery3.1, and the standard QLBs for EXSLT and STX have been withdrawn) ;
- new elements group library and rules have been added;
- (Element group allows rule-sets instead of patterns: a rule-set is a group of rules that are evaluated Independently as if each rule were in a separate pattern.)
- (Element library is an alternative top-level element that indicates that the declarations will be included in a main schema.)
- (Element rules is a container for abstract rules.)
- new attribute as has been added to element let, to enable datatyping of variables;
- new attributes schematronEdition and severity have been added;
- param elements are now allowed for schemas and abstract patterns and in the latter case their value can act as a default;
- attributes flag, role and severity are dynamically evaluated if their value is a variable reference;
- element extends is made available at the top level of a schema;
- the methods of base URI fixup and language fixup are specified;
- a mapping of schema to SVRL structures is provided in Annex D.
As well, according to the GitHub schema
- The phase element has attributes @from and @to which restrict the validation of a phase to particular location paths.
- The contents of an @flag attribute is no longer a string, but a list of tokens.
You can tell if a Schematron schema uses the newfeatures, because its /sch:schema/@schematronEdition attribute will have the value "2025".
Cheat Sheet
Overview
What Makes Schematron Unique?
Who Uses Schematron?
USE-CASE: During the COVID 19 epidemic, Schematron helped organize the monitorig of services: in the US, real-time data on Emergency Medical admissions and causes is collected by National Emergency Medical Services Information System (NEMSIS). Schematron allowed them a practical route to having subject-matter experts specify rules in plain English, then developers implement exactly those rules. Read their excellent Schematron Guide, or see their online Library of national and state-level Schematron Rules. (Hint: try “PA”)
Open Source Implementations
Implementation
Open Standard
Open Licensing
In the long run, I think Schematron may well be the XML project’s greatest technical
legacy to the world.
Simon St Laurent, Technical Journalist and O’Reilly Editor, xml-DEV list, 19 May 2016