26 chars · 1 line
Waiting for input
26 chars · 1 line
Waiting for input
XML attribute escaping
The sample opens note with a double quote and then uses another literal double quote before hello, which ends the attribute early. Escape delimiter quotes as entities or use the other quote style around the whole value. This tool is free to use. No account or payment is required.
Last updated
XML uses the opening quote to decide where an attribute value begins and the matching quote to decide where it ends. Entity references let the same character appear as data without changing the syntax boundary.
Encode the inner double quotes while keeping double quotes as the value delimiter.
<root note="say "hello""/><root note="say "hello""/>Common questions
Use " for the inner double quote.
Yes. Single-quoted and double-quoted attribute values are both valid XML.
No. Quote characters are normally fine in element text; this issue is specific to attribute delimiters.
Debugging a specific XML issue? Browse XML troubleshooting.