Skip to main content

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.

order.xsd
<?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

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.