XML / XPath / XSD

XSD validatorcheck structure, types and local dependencies

Run manually or press Ctrl/Cmd+Enter. The sample includes a main schema and a referenced type definition.

XSD validator

XML input

Current XSD

XML and schema contents stay in this browser; validation does not upload your documents.

Relative ASCII paths, e.g. types/common.xsd. References resolve from the containing schema; no URLs or paths outside the virtual root.

Manual run; 10 seconds including engine loading. XML and each schema: 1,000,000 characters; all schemas: 2,000,000; at most 20 schemas; depth 100.

Result is out of date. Validate again to enable export.

An XSD validator answers a different question from an XML syntax checker: does this document obey the selected schema? A quantity can be well-formed text and still violate an integer restriction or the permitted range.

Use XML schema validation before integrating a feed or configuration. To validate XML against XSD, provide the entry schema and every local dependency; the engine checks the supplied set instead of guessing a schema from the document.

Why use this XSD validator?

Keep the schema set together

The XSD validator resolves xs:include and xs:import against named local files. A type defined in types.xsd can constrain quantity in the main document; missing dependencies remain explicit failures.

A main schema and two local dependencies feed into one XML validation result.

Trace a constraint to its source

An invalid quantity should lead back to the offending XML line, while an undefined type may originate in a schema. Diagnostics identify the source when the engine provides it and keep the original constraint message.

A marked XML value connects to its source line and an error report.

Three checks before trusting the result

01

Choose the entry schema

The main path defaults to main.xsd. XML schema-location hints do not select or download another schema. Pick the file declaring the root element, then add its dependencies.

02

Match each reference path

A schema in orders/main.xsd can include ../types.xsd within the virtual root. Imported filenames can be edited after reading UTF-8 files; duplicate normalized paths are rejected.

03

Run again after editing

Changes cancel an active worker and invalidate the old report. Press Ctrl/Cmd+Enter after the final edit. Switching the visible schema alone does not alter the validation request.

Real constraints, readable diagnostics

Schema compilation before validation

The libxml2 WASM engine compiles XSD 1.0 before checking the XML instance. Undefined types and invalid schema structure are reported separately from a document failing its declared rules.

Types, order and namespaces

The sample restricts quantity to an integer from 1 to 100. Required elements, occurrence limits, sequences and namespace-qualified declarations are evaluated by the engine rather than by a list of allowed tag names.

Share the completed report

Copy or download JSON for a completed valid or invalid run. The report records its phase, engine and captured diagnostics. Position fields remain absent when unknown; a missing column is never presented as a measured column one.

Accepted inputs and deliberate limits

XML 1.0 and XSD 1.0
XML declarations must use version 1.0 and UTF-8 when an encoding is stated. XSD 1.1 constructs such as assertions, alternatives and overrides are rejected. A schema’s ordinary version attribute is application metadata, not a request to switch engines.
Explicit local references
Provide schemaLocation for every include, import or redefine. Paths use ASCII letters, digits, dots, underscores, hyphens and slashes; URLs, percent escapes, absolute paths and traversal outside the root are rejected. xml:base and DOCTYPE are not accepted.
Bounded worker execution
XML and each schema allow 1,000,000 JavaScript string characters. All schemas together allow 2,000,000 characters and 20 files including the main schema; depth is limited to 100. The worker is terminated after 10 seconds, including initialization. These are character limits, not megabytes.
Reports have a capture limit
At most 200 diagnostics are retained and shown 50 at a time; a truncation flag marks omitted diagnostics. Each engine message is limited to 4,000 characters. Runtime failures and stale reports cannot be exported. No claim is made that every parser reports every error.
No automatic repair or business approval
The tool does not rewrite XML, generate schemas, apply Schematron or verify digital signatures. Passing a schema does not guarantee that a bank, tax platform or receiving API will accept the document.
Review replacements
Examples, clearing, file imports and dependency removal show the proposed replacement before Apply. One Undo restores inputs and the previous report. Editing text is direct; this is not a persistent file store or a batch XML processor.

XSD validator questions

How can I check an XML document against its schema?

Paste both the XML and the entry XSD, supply the local schemas it references, and run validation. Well-formed XML alone does not demonstrate schema conformance; the result must reach the validation phase.

How do include and import differ in XSD?

Include combines schema components for the same target namespace, including permitted no-namespace inclusion. Import makes components from another namespace available. Supply every referenced local file with the exact relative path used by the containing schema.

Why is an external schema file reported as missing?

Check schemaLocation spelling and case, the containing file’s path and the complete dependency chain. This page only resolves supplied local files; a remote URL or an omitted dependency cannot be fetched automatically.

Which XML Schema version can the validator process?

The engine implements XSD 1.0. Features specific to XSD 1.1, including xs:assert and xs:override, are rejected instead of being silently treated as valid constraints.

Does validation send my files to a server?

Document contents are processed in a browser worker rather than submitted for validation. Reading dependency files loads them into the current page. Copy and download occur only when you request them; refreshing the page discards the current work.

Does a diagnostic look unexpected?

Check a schema-dependent document

Use the XSD validator to reproduce a mismatch with the same XML, entry schema and dependency paths. Save the completed report alongside that exact input set.