XML Schema Validator

Validate XML documents against XSD schemas. Get detailed error diagnostics with XPath locations, suggested fixes, and schema analysis. All processing happens locally in your browser.

XML Document
394 B

How to Use

  1. Paste or upload your XML document in the left panel.
  2. Paste or upload your XSD schema in the center panel.
  3. Click “Validate XML Against XSD” to run validation.
  4. Review errors in the Results panel with XPath locations and fix suggestions.
  5. Switch to the Schema Info tab to see declared types and elements.

What is an XSD?

An XML Schema Definition (XSD) is a W3C standard that describes the structure, content, and data types permitted in an XML document. Unlike DTDs, XSD schemas are themselves XML documents and support namespaces, complex type inheritance, and rich data type validation.

XSD schemas define which elements and attributes are allowed, in what order they must appear, how many times they can repeat, and what data types their content must conform to.

XML Validation vs XSD Validation

Well-Formedness Check

Verifies XML syntax: proper nesting, closed tags, valid characters. Does not check business rules or data types.

Schema Validation

Checks conformance to a schema: required elements, data types, cardinality, enumerations, attribute constraints, and element order.

Common XML Schema Errors

  • Missing required element: The schema expects a child element that is absent from the XML.
  • Invalid data type: A text value does not match the declared type (e.g., “abc” for xs:integer).
  • Cardinality violation: Too many or too few occurrences of an element relative to minOccurs/maxOccurs.
  • Invalid enumeration: The value is not in the list of allowed values defined by xs:enumeration.
  • Missing required attribute: An attribute marked use=“required” is not present on the element.
  • Unexpected element: An element appears that is not declared in the schema for its parent context.

Related Tools

Frequently Asked Questions

What is XML Schema Validation?

XML Schema Validation checks whether an XML document conforms to the rules defined in an XSD (XML Schema Definition) file. It verifies element structure, attribute presence, data types, cardinality constraints, and enumeration values.

How is this different from the XML Validator?

The XML Validator checks well-formedness (valid syntax). The XML Schema Validator goes further by checking structural and data-type conformance against a specific XSD schema you provide.

What XSD features are supported?

The tool supports xs:element, xs:complexType, xs:simpleType, xs:sequence, xs:choice, xs:all, xs:attribute, xs:restriction (enumeration, pattern, minLength, maxLength, minInclusive, maxInclusive), data type validation (string, integer, decimal, boolean, date, dateTime), minOccurs/maxOccurs cardinality, and namespace validation.

Are there XSD features not supported?

Advanced features like xs:key/xs:keyref identity constraints, xs:redefine, xs:union, xs:list, and xs:import with external URI resolution are not fully supported in this browser-based tool. These require server-side processing or external file access.

Is my XML or XSD uploaded to a server?

No. All parsing and validation run entirely in your browser using JavaScript. No data is transmitted to any server.