Quick answer

When the XML is well-formed but does not follow the rules defined in the XSD (wrong element names, wrong types, missing required elements, or wrong order), the validator reports schema mismatch errors.

XML Does Not Match XSD Schema

When the XML is well-formed but does not follow the rules defined in the XSD (wrong element names, wrong types, missing required elements, or wrong order), the validator reports schema mismatch errors.

Common causes

How to fix

Examples

Bad

<root><extra>not in schema</extra></root>

Good

<root><author>Name</author><content>Text</content></root>

FAQ

What does 'element not allowed' mean in XSD?
The element at that position is not declared in the schema for the parent element, or the content model does not allow it there.
Can the order of elements matter in XSD?
Yes. <xs:sequence> requires a fixed order; <xs:all> allows any order; <xs:choice> allows one of the options.

Fix it now

Try in validator (prefill this example)

Related

All tools · Canonical