Quick answer

Before an XML document can be validated against an XSD schema, it must be well-formed.

Invalid XML Instance

Before an XML document can be validated against an XSD schema, it must be well-formed. Unclosed tags, wrong nesting, or invalid characters cause the parser to fail before schema validation runs.

Common causes

How to fix

Examples

Bad

<root>
  <item>value
</root>

Good

<root>
  <item>value</item>
</root>

FAQ

Do I need to fix XML before XSD validation?
Yes. The validator must parse the XML first; if it is not well-formed, schema validation cannot run.
What is well-formed XML?
Single root element, every opening tag has a matching closing tag, attributes are quoted, and no invalid characters.

Fix it now

Try in validator (prefill this example)

Related

All tools · Canonical