41 chars · 1 line
Waiting for input
41 chars · 1 line
Waiting for input
XML entity troubleshooting
The sample places a literal & between words. XML interprets ampersand as the start of an entity or character reference, so ordinary text must encode the character as & before the document can parse. This tool is free to use. No account or payment is required.
Last updated
XML reserves & for entity references. Text such as A & B is not valid character data until the ampersand is escaped. The parser cannot safely guess whether the following characters were meant to form an entity name.
If the source already contains &, changing it to & changes the data. Fix only bare ampersands that represent the literal character.
Encode the data character with the predefined & entity.
<company>Research & Development</company><company>Research & Development</company>Common questions
Use & when the data should contain a literal ampersand character.
Yes. A literal ampersand in an attribute value must also be represented with valid entity syntax.
No. Existing valid entity or character references already use ampersand syntax and should not be double-escaped.
Debugging a specific XML issue? Browse XML troubleshooting.