Reference
XSD validation errors
Every document on these pages is well-formed XML. These are the failures that only appear once a schema is applied — which is where an integration's actual contract lives.
Well-formed is not valid
A document that parses has passed one test: it is XML. Whether it is the right XML — the fields your partner agreed to send, in the order and the types the contract names — is a separate question, and only a schema can answer it.
That is why these errors have their own section. Nothing here is a parse failure; if your document will not parse at all, the well-formedness errors are the ones you want, and you have to clear those first — a document with no tree cannot be checked against anything.
XMLDir reports these through libxml2. Xerces words them with the cvc- codes people actually paste into a search box, so every page lists both.
Every example in this section is validated against this one schema, so each page changes only the document.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="status">
<xs:restriction base="xs:string">
<xs:enumeration value="open"/>
<xs:enumeration value="closed"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sku">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{2}-\d{4}"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="order">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" type="xs:string"/>
<xs:element name="issued" type="xs:date"/>
<xs:element name="state" type="status"/>
<xs:element name="line" minOccurs="1" maxOccurs="2">
<xs:complexType>
<xs:sequence>
<xs:element name="code" type="sku"/>
<xs:element name="qty" type="xs:positiveInteger"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
Every documented schema error
The attribute is required but missing
Element 'order': The attribute 'id' is required but missing. (line 2)The schema marks an attribute use="required" and the document does not carry it. Well-formed, and rejected by the first consumer that validates.
The attribute is not allowed
Element 'order', attribute 'ref': The attribute 'ref' is not allowed. (line 2)The document carries an attribute the schema never declared. XSD is closed by default: anything not named is forbidden rather than ignored.
This element is not expected
Element 'note': This element is not expected. (line 10)An element appeared where the schema's content model does not allow one — an extra child, an unknown child, or the right children in the wrong order.
Missing child element(s)
Element 'order': Missing child element(s). Expected is ( line ). (line 2)The element ended before its content model was satisfied. The schema names what it was still waiting for, which makes this the most actionable schema error.
Not a valid value of the atomic type
Element 'issued': '31/01/2026' is not a valid value of the atomic type 'xs:date'. (line 4)The element's text does not fit its declared datatype. Dates are the usual culprit, because XSD accepts exactly one format and humans write several.
The value is not an element of the set
Element 'state': [facet 'enumeration'] The value 'pending' is not an element of the set {'open', 'closed'}. (line 5)The value is not one of the permitted options. The message lists the full set, which makes it the one schema error that tells you the answer outright.
The value is not accepted by the pattern
Element 'code': [facet 'pattern'] The value 'widget' is not accepted by the pattern '[A-Z]{2}-\d{4}'. (line 7)The value does not match the regular expression the schema constrains it with — the usual guard on SKUs, references, IBANs and postcodes.
No matching global declaration for the validation root
Element 'invoice': No matching global declaration available for the validation root. (line 2)The validator could not find the root element in the schema at all — nearly always a namespace mismatch rather than a genuinely unknown element.
Have a document and a schema in front of you? Run them through the XSD validator and it will name every violation with its line.
Get started
Bring order to the XML your team can't afford to ignore.
Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.