Documentation · Errors
XML error messages explained
What the validator's messages mean and how to fix them. These come from libxml2, the parser behind the validator and behind PHP, Python's lxml, xmllint and many other tools, so you will meet the same wording elsewhere.
A business rule failed, such as BR-CO-15 or PEPPOL-EN16931-R001? See business rules explained.
Well-formedness
- Opening and ending tag mismatch An end tag does not match the start tag it should close.
- Premature end of data in tag The document ends while an element is still open.
- Extra content at the end of the document Something follows the root element, which must be the last thing in the document.
- Start tag expected, '<' not found The document does not start with an element.
- Document is empty There is no element in the document at all.
- Entity not defined The document uses a named entity, like &nbsp;, that XML does not know.
- xmlParseEntityRef: no name A bare ampersand (&) in text or an attribute.
- Specification mandates value for attribute An attribute without a value, or a space inside a tag name.
- AttValue: " or ' expected An attribute value is not in quotes.
- Unescaped '<' not allowed in attributes values A < character inside an attribute value.
- StartTag: invalid element name A < that does not start a valid element name.
- Attribute redefined The same attribute appears twice on one element.
- XML declaration allowed only at the start of the document Something comes before <?xml …?>, or there are two declarations.
- PCDATA invalid Char value A control character that XML 1.0 does not allow.
- Invalid bytes in character encoding The file is not in the encoding it claims (UTF-8 unless it says otherwise).
- Namespace prefix is not defined An element or attribute uses a prefix (inv:) without its xmlns:inv declaration.
- Comment not terminated A comment is not closed with -->, or contains --.
XML Schema (XSD)
- This element is not expected An element is in the wrong place: out of order, misspelt, or not allowed there.
- Is not a valid value of the atomic type A value does not match its data type: a number, a date, a boolean…
- Missing child element(s) A required child element is missing.
- The attribute is required but missing An attribute declared with use="required" is not on the element.
- The attribute is not allowed An attribute the schema does not declare for this element.
- No matching global declaration available for the validation root The schema has no top-level declaration for the document's root element.
- [facet 'enumeration'] The value is not an element of the set A value that is not on the schema's list of allowed values.
- [facet 'pattern'] The value is not accepted by the pattern A value that does not match the regular expression the schema requires.
- [facet 'maxLength'] The value exceeds the allowed length A value longer (or shorter) than the schema allows.
- Character content other than whitespace is not allowed Text directly inside an element that may contain only child elements.
DTD
- No declaration for element The DTD does not declare an element the document uses.
- Element content does not follow the DTD An element's children don't match its content model: order, count or which ones.
- No declaration for attribute The DTD does not declare an attribute the element carries.
- Element does not carry attribute An attribute declared #REQUIRED in the DTD is missing.
RelaxNG
- Did not expect element there An element the RelaxNG pattern does not allow at this point.
- Expecting an element, got nothing A required element is missing at the end of its parent.
- Type doesn't allow value A value that does not fit the datatype in the RelaxNG pattern.
- Invalid attribute for element An attribute the pattern does not allow, or a required one missing.