XML error · prolog
standalone accepts only 'yes' or 'no'
The XML declaration's standalone pseudo-attribute has a closed vocabulary: lowercase yes or no, with no boolean aliases.
standalone accepts only 'yes' or 'no' (line 1)What it means
standalone declares whether information outside the document entity affects the document. XML spells its only two values yes and no, case-sensitively; true, false, 1, 0 and maybe are not aliases.
This is declaration syntax, so the parser stops before it attempts to build the root element. The rest of the document may be perfectly formed and still cannot be read.
What usually causes it
- A serializer mapped a programming-language boolean to true or false.
- A hand-written declaration used Yes or NO rather than lowercase XML tokens.
- A template exposed a three-state application setting directly in the declaration.
- Copying an XML-like declaration from a format with different boolean spelling.
How to fix it
- Use standalone="yes" only when the standalone declaration is true.
- Use standalone="no" when external declarations may affect the document.
- Omit standalone entirely when the producer does not know or need to assert it.
The same error elsewhere
Different parsers, same defect. If you arrived with one of these messages, you are in the right place.
expat (Python)
XML declaration not well-formed: line 1, column 30.NET System.Xml
Syntax for an XML declaration is invalid.
Before and after
Both snippets are re-checked by the test suite against the real parser: the first is confirmed to produce the exact error above, the second to parse cleanly.
<?xml version="1.0" standalone="maybe"?><root/><?xml version="1.0" standalone="yes"?><root/>Where this bites most
Other XML errors
- Opening and ending tag mismatch
- Premature end of data in tag
- Extra content at the end of the document
- Unescaped ampersand (EntityRef: expecting ';')
- Entity is not defined
- Start tag expected
- XML declaration allowed only at the start of the document
- Unquoted attribute value (AttValue expected)
- Attribute redefined
- Attributes construct error (unterminated quote)
- Invalid element name
- Document is empty
- Unsupported encoding
- Sequence ']]>' not allowed in content
- Comment not terminated
- Detected an entity reference loop
- PCDATA invalid Char value (control character)
- Unescaped '<' in an attribute value
- Invalid numeric character reference
- Blank needed here
- Malformed declaration expecting version
- Unsupported XML version
- Processing instruction not terminated
- CData section not finished
- Error parsing attribute name
- Double hyphen within comment
- CharRef: invalid decimal value
- CharRef: invalid hexadecimal value
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.