Overview
ISO/IEC 19757-2:2008 defines RELAX NG, a regular-grammar-based schema language for XML as part of the Document Schema Definition Language (DSDL) family. The standard specifies how a RELAX NG schema describes patterns for the structure and content of XML documents using a regular tree grammar, and establishes the formal requirements for when an XML document “matches” a RELAX NG schema. The document includes full and compact syntaxes, transformation rules that simplify schemas, formal semantics, and conformance criteria for validators.
Key topics and requirements
- Schema language specification: Formal definition of RELAX NG patterns for elements, attributes, text, data, lists, interleaving, and grouping.
- Regular tree grammar: Use of regular-grammar constructs to express valid XML tree structures and content models.
- Syntax and simplification: Full XML-based syntax and the RELAX NG Compact Syntax (compact, human-friendly form), plus rules for simplifying schemas into a canonical simple form.
- Semantics and validation: Formal inference rules and semantics that define when an XML document is valid against a RELAX NG schema.
- Datatype support: Integration points for datatype libraries (built-in and external) and mechanisms for data/value validation.
- Restrictions and conformance: Constraints on schema constructs, prohibited patterns, and formal conformance requirements for RELAX NG validators and translators.
- Normative annexes: Includes a RELAX NG schema for RELAX NG itself, examples, and the compact syntax specification to aid implementers.
Applications and who uses it
RELAX NG (ISO/IEC 19757-2:2008) is widely used for:
- XML schema authors who need an expressive, easy-to-read schema language for complex document grammars.
- Tool and validator developers building XML validation engines that implement RELAX NG conformance rules.
- Document architects and integrators designing document exchange formats, technical documentation, or content models where flexible content ordering (interleave) and concise schemas are beneficial.
- Data governance and standards teams that require formal validation for XML-based data interchange, publishing, or archiving.
Practical applications include document format design, configuration file schemas, content management systems, and data interchange formats where robust, formally defined XML validation is required.
Related standards
- ISO/IEC 19757 (DSDL) family - other parts include:
- Part 3: Schematron (rule-based validation)
- Part 4: NVDL (namespace-based validation dispatching)
- Other DSDL parts cover datatypes, character repertoires, and DTD-related declarations
Keywords: ISO/IEC 19757-2:2008, RELAX NG, DSDL, XML schema, regular-grammar-based validation, RELAX NG Compact Syntax, XML validation, schema language.