XML error reference · XV020
Malformed entity reference
An entity reference is missing its terminating semicolon or contains an invalid name.
What your parser calls it
The same problem, reported differently by each parser. If you arrived here from one of these strings, you are in the right place.
| Parser | Message |
|---|---|
| Firefox DOMParser | XML Parsing Error: EntityRef: expecting ';' |
| libxml2 / xmllint | EntityRef: expecting ';' |
What causes it
An entity reference is `&` followed by a name followed by `;`. If the semicolon is missing, or the name contains a space or a character not allowed in XML names, the parser cannot resolve it. Writing `&` without the semicolon is the most frequent instance.
See it happen
<p>Tom & Jerry</p><p>Tom & Jerry</p>How to fix it
Add the missing semicolon, or escape the ampersand as `&` if it was meant to be literal text. Only five entities are predefined in XML: `&`, `<`, `>`, `"` and `'`. Anything else must be declared in a DTD first.
Fix your own document
Paste your own document below. Press Sample if you want the broken example above loaded instead. Nothing you paste leaves this tab.
XML Validator
Well-formedness and schema validation. Nothing is uploaded.
Everything runs in this tab. Nothing you paste is uploaded, logged or sent anywhere. Open your network panel and check.