SOAP envelope
What goes wrong in SOAP envelope
The 13 errors this corpus records against SOAP envelope documents, keyed by the message your parser printed. Nothing here is written for this page — each error declares the formats it bites, and this is that declaration read the other way round.
Start with the message you were given
Every entry below states the message our validator emits, verbatim, and a test asserts it still does. If you are holding a broken document rather than a question, XML validator will tell you which of these you have.Parse errors · 9
These stop the document being read at all. Nothing downstream sees a file with one of them, because it is not XML.
- Opening and ending tag mismatch
Opening and ending tag mismatch: item line 2 and channel (line 4)An element was closed out of order: the parser met an end tag for an ancestor while a child was still open, so the tree cannot be built at all. - XML declaration allowed only at the start of the document
XML declaration allowed only at the start of the document (line 2)Whitespace precedes the XML declaration. A single blank line, or one space, before it is enough to make the document not well-formed. - Unsupported encoding
Unsupported encoding: UTF-9 (line 1)The declaration names an encoding the parser cannot decode — a typo, a vendor-specific label, or a charset the build of libxml2 was not compiled with. - Detected an entity reference loop
Detected an entity reference loopTwo declared entities refer to each other in a cycle. The parser stops rather than expand forever — the same guard that blocks a billion-laughs attack. - PCDATA invalid Char value (control character)
PCDATA invalid Char value 1 (line 2)A raw control character reached element content. XML 1.0 forbids most of them, and no escaping makes them legal — they must be removed at the source. - Unescaped '<' in an attribute value
Unescaped '<' not allowed in attributes values (line 2)A literal < inside an attribute value. XML forbids it there because the parser cannot tell it from the start of a tag, so it must be written <. - Blank needed here
Blank needed here (line 1)Two parts of the XML declaration ran together with no space between them. Terse enough to be baffling, and it always means the same thing. - Unsupported XML version
Unsupported version '2.5' (line 1)The declaration names an XML version that does not exist. There are only two — 1.0 and 1.1 — and in practice you want 1.0 unless you know otherwise. - Error parsing attribute name
error parsing attribute name (line 2)A start tag was never closed with >, so the parser kept reading and found the next element's markup where an attribute name should have been.
Schema errors · 4
These appear only once a schema is applied. A document can be perfectly well-formed and fail every one of them.
- 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. - 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.
Back to SOAP envelope — root element, namespaces, constraints and a worked example.
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.