XML error · attribute
Unquoted attribute value (AttValue expected)
An attribute value is not quoted. XML requires quotes around every value, including numbers — unlike HTML, which accepts bare values happily.
AttValue: " or ' expected (line 1)What it means
Every XML attribute value must be wrapped in single or double quotes. HTML allows bare values like width=100; XML does not, and the parser stops as soon as it finds an unquoted one.
A bare attribute with no value at all — HTML's <video controls> style — is a related but distinct error, reported as "Specification mandates value for attribute controls".
What usually causes it
- An unquoted value: <url priority=0.8/>.
- A template variable that rendered empty and collapsed the ="" entirely.
- A quote stripped by a shell, a CSV round-trip, or an over-eager sanitiser.
- HTML-style boolean attributes carried into XML.
How to fix it
- Quote all attribute values, including numbers.
- Render empty variables as ="" rather than omitting the assignment.
- For HTML-style booleans, repeat the name: controls="controls".
The same error elsewhere
Different parsers, same defect. If you arrived with one of these messages, you are in the right place.
Xerces (Java)
Open quote is expected for attribute "priority" associated with an element type "url".expat (Python)
not well-formed (invalid token): line 1, column 14.NET System.Xml
Expected an attribute value, but found '0'.
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.
<url priority=0.8><loc>https://example.com/</loc></url><url priority="0.8"><loc>https://example.com/</loc></url>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
- 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
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.