Glossary · 3 · Publishing SDKs and structured content
Schematron
Also known as: ISO Schematron, Rule-based validation language
In XML processing, Schematron is a rule-based schema language, standardized as ISO/IEC 19757-3, that validates XML documents by testing assertions written as XPath expressions against selected parts of a document and reporting violations in natural-language messages.
- Publishing SDKs
- Standards
In one sentence
Schematron (ISO/IEC 19757-3) validates XML with XPath-based rules and assertions, reporting business-rule violations in plain-language messages.
Example
A Schematron rule checks that every hazard statement in a DITA topic has a signal word and a consequence, and reports “Hazard statement without consequence” with the topic's location.
How it applies
- Publishing SDKs: Grammar-based schemas (a DTD, XML Schema or RELAX NG) say which elements may appear where. Schematron adds rules that grammars cannot express well: co-occurrence constraints, house style, required metadata, consistency between parts of a document. Publishing pipelines run it before transformation, alongside schema validation.
- Structure of a schema: A Schematron schema consists of patterns, which contain rules; each rule selects a context with an XPath expression and makes assertions (
assert) or reports (report) about it. Results can be written in the Schematron Validation Report Language (SVRL). - Implementation: Schematron is commonly implemented by compiling the schema into an XSLT stylesheet that is then run against the documents, so it fits toolchains that already use XSLT.
- Docs as code: Rules run in continuous integration on every change, and their messages tell writers what to fix in their own words.
- Limits: Schematron checks what its rules express. Passing validation shows that the document meets those rules, not that its content is correct, complete or compliant with any requirement.
Schematron vs. grammar-based schemas
A grammar describes the allowed structure as a whole and rejects everything else. Schematron describes conditions that must hold and reports exactly those that fail; anything not covered by a rule is allowed. The two are complementary, which is why ISO/IEC 19757 (DSDL) groups them as parts of one family.
Editions
As of October 11, 2026, schematron.com reports that the fourth edition of ISO/IEC 19757-3 was published in 2025; schemas written for it declare schematronEdition="2025". Earlier editions remain in use in many toolchains.