Quick answer

An XSD schema is an XML document.

Invalid XSD Schema

An XSD schema is an XML document. If the XSD itself is not well-formed (unclosed tags, wrong nesting, invalid attributes), validators cannot load it and will report an error.

Common causes

How to fix

Examples

Bad

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="r" type="xs:string"
</xs:schema>

Good

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="r" type="xs:string"/>
</xs:schema>

FAQ

Is XSD valid XML?
Yes. An XSD document is XML; it must be well-formed before a validator can use it as a schema.
What namespace does XSD use?
W3C XML Schema uses http://www.w3.org/2001/XMLSchema, typically with the xs: prefix.

Fix it now

Try in validator (prefill this example)

Related

All tools · Canonical