Overview
ISO/IEC 19757-3:2020 defines Schematron as a rule-based schema language for XML within the DSDL (Document Schema Definition Languages) framework. The standard establishes syntax, semantics and conformance requirements for Schematron schemas and specifies when an XML (or SGML-derived XML) document matches the patterns expressed by a Schematron schema. Schematron relies on query languages such as XPath (and bindings to XSLT/XPath versions) for writing assertions and producing validation outcomes.
Key topics and technical requirements
- Schema syntax and core elements: normative definitions for Schematron constructs including schema, pattern, rule, assert, report, diagnostic, and supporting elements such as let, ns, name, param, include, extends, active.
- Well-formedness and namespace rules: requirements for valid Schematron documents (whitespace handling, namespace usage).
- Semantics and validation function: formal description of how Schematron patterns and rules determine whether an XML document conforms.
- Query language bindings: normative bindings for multiple environments - XSLT 1/2/3 and XPath 2/3 are covered in annexes; EXSLT and STX bindings are informative. These bindings define how XPath/XSLT expressions are evaluated in Schematron assertions.
- Annexes and artifacts: includes a RELAX NG schema for Schematron (Annex A), Schematron constraints schema (Annex B), the Schematron Validation Report Language (SVRL) example (Annex D), and additional normative/query-binding annexes.
- Conformance levels: clauses for simple conformance and full conformance that tool vendors and implementers must follow.
Applications and practical value
- Rule-based XML validation: express constraints that are difficult or impossible with grammar-based schemas (e.g., inter-element co-occurrence, conditional rules).
- Complementary validation: integrate with other DSDL parts (e.g., RELAX NG) to perform layered validation across different parts of an XML document.
- Customizable reports: produce targeted validation messages and diagnostics (SVRL examples provided) to support QA, publishing workflows, and automated XML pipelines.
- Portable validation logic: query-language bindings let you run Schematron rules in diverse environments (XSLT processors, XPath-capable engines).
Who should use this standard
- XML architects and schema authors who need expressive, rule-based validation.
- Software developers and tool vendors implementing Schematron validators or integrating validation into toolchains.
- QA engineers, technical writers and content managers who require precise validation rules and actionable report output.
- Standards bodies and integration projects that combine multiple schema technologies under DSDL.
Related standards
- ISO/IEC 19757 (DSDL series) - other parts for complementary validation technologies.
- ISO/IEC 19757-2 (RELAX NG) - used in Annex A and for schema interchange.
- W3C XPath/XSLT specifications - referenced via query language bindings.