>_devtools

XSD Validator

Validate an XML document against an XSD schema with libxml2 running in your browser.

What this does

Checks an XML document against an XML Schema (XSD) and lists every violation with its line number: a missing required element or attribute, a value of the wrong type, elements in the wrong order, or too many or too few occurrences. It runs libxml2, the same validator behind xmllint, compiled to WebAssembly.

Example

"Load example" fills in a small order document and its schema. The document contains one deliberate mistake: aquantity of 0, which the schema declares as xs:positiveInteger.

Limits

  • The schema must be self-contained. xs:import and xs:include of other files cannot be resolved, because nothing is fetched from the network.
  • XSD 1.0 only. XSD 1.1 features such as assertions are not supported.
  • The document and schema together are limited to 2 MB.
  • Use the XML validator for a plain well-formedness check without a schema.

Privacy

The validator is a WebAssembly module served from this site (about 780 KB, loaded only when you press Validate). Your document and schema never leave the browser.