XSD (XML Schema Definition)
XSD is the W3C schema language that defines what a valid XML document looks like — allowed elements and attributes, order, cardinality, and datatypes — the mechanism used to validate ISO 20022 payment files and other regulated XML.
What a schema specifies
A schema declares elements (xs:element) with types, order constraints (xs:sequence, xs:choice, xs:all), occurrence ranges (minOccurs/maxOccurs), and datatypes — built-ins like xs:string, xs:decimal, xs:date plus derived types restricted by facets (patterns, enumerations, length, ranges). Complex types nest; attributes are declared on the containing type.
Validation is two-level: well-formedness first (the XML parses at all), then schema conformance (the right elements in the right order with legal values). Banks reject pain.001 files at exactly this layer — a misplaced tag or an out-of-range amount is a schema violation, not a business error.
Using it in practice
A document declares its schema via the namespace (and optionally xsi:schemaLocation). Validators resolve the schema and report violations with line/column positions. Our XSD validator checks documents against ISO 20022 message schemas and custom schemas entirely in the browser.
Related Terms
Related Standards
- •XML Schema Part 1 (structures) and Part 2 (datatypes) — W3C
- •ISO 20022 — published message schemas
Free Tools & Resources
Need help with this?
We consult and build across all of these domains — tell us what you are working on.
