ISO Schematron 2020

ISO Schematron 2020

The new 2020 edition of ISO Schematron has been released, adding "QLB" documentation for how XSLT3/XPath3 can be used. The 2016 edition is still available free from the ISO website. Schemas made with the 2006 and 2016 editions are compatible with the 2020 edition without alteration.

Open Standard

Open Standard

ISO Schematron is an Open Standard adopted by hundreds of major projects in the past decade

Open Source

Open Source

A mature free implementation suitable for integration into servers and applications, with no license fees or IP issues. Download the "skeleton" implementation from GitHub.
(And check out the newer SchXslt implementation too!)

What is Schematron? A language for making assertions about the presence or absence of patterns in XML documents.

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

To Overview >

What is Schematron used for? Business rules validation, data reporting, general validation, quality control, quality assurance, firewalling, filtering, constraint checking, naming and design rules checking, statistical consistency, data exploration, transformation testing, feature extraction, house-style-rules checking

NEWS: Schematron helping our fight against COVID: in the US, real-time data on Emergency Medical admissions and causes is collected by National Emergency Medical Services Information System (NEMSIS). Schematron has 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”)

What makes Schematron unique? Schematron is very simple (only five important elements), very powerful (it can express many kinds of constraints impossible in other schema languages), very diverse (it can be used for business rules, reports as well as the kinds of static constraints usually associated with schemas.)

It places particular emphasis on capturing constraints in human language assertions and generating appropriate human-language diagnostics: this allows a level of user-friendliness not available in other schema languages.

As well, the phase mechanism let you choose which set of patterns you want to look for next, to suit your workflow and to handle versions and variants.

Schematron schemas can validate co-constraints (if some data is one value, some other data should be constrained to certain values) and even jump across links and between XML documents to check constraints. The diagnostics facility allows multi-lingual schemas.

To Why Schematron is Different
(Plus summary of all features) >

Who uses Schematron? Schematron is an ISO standard which has uptake in many industries, notably the financial, insurance, governmental record exchange, police, and technical and reference publishing sectors. Some examples:

Government and International Agencies

Government and International Agencies (Europe)

Naming and Design Rules

What implementations are available?  Before 2020, the major implementation suitable for integrators was the skeleton implementation here at, which can be found (with other resources) at Github.. This is an open source implementation which is quite mature, having been in continuous use and development since early 2000. This implementation uses XSLT1 and XSLT2 and can run in any environment that can invoke XSLT transformations: there are no plans to move this to support XPath 3.  Going forward, developers are encouraged to first check out the fresh implementation SchXslt by David Maus, also available on GitHub.

To Implementation >

Is Schematron a replacement for XSD? While Schematron can express most of the same constraints that can be expressed in grammar-based schema languages such as XSD (W3C XML Schemas), RELAX NG and DTDs, very often it is used as an adjunct to supplement the intrinsic weak points of grammars if necessary, or to express constraints that may belong to a different conceptual layer such as business rules. (The instigator of Schematron also was a member of the working groups that defined XML DTDs, RELAX NG and XSD, so by design their weaknesses in key practical areas are precisely what Schematron is strong at: comprehensible error messages in terms users understand, open schemas that only validate the things of interest at a particular phase in the documents life or pipeline, a small set of simple elements that is easy to learn and hack, integration into an XML- or DOM-based tool chain, making the power of XPath available without the complexity of XSLT.)