20 chars · 1 line
Waiting for input
20 chars · 1 line
Waiting for input
XML attribute quoting
The sample writes port=8080 without quotes. Unlike HTML syntax accepted by some browsers, XML requires every attribute value to use a quoted literal such as port="8080" or port='8080'. This tool is free to use. No account or payment is required.
Last updated
There is no unquoted shortcut for simple numeric or word values in XML. The quotes define the attribute value boundary and keep whitespace or following attributes unambiguous.
Both single and double quotes are valid delimiters. If the data contains one quote character frequently, using the other as the delimiter can keep the serialized XML easier to read.
Add quotes around the numeric port value.
<service port=8080/><service port="8080"/>Common questions
Yes. XML requires quoted attribute values regardless of the value type.
Yes. Either matching single or double quotes can delimit an XML attribute value.
HTML parsing rules are more permissive in some cases. XML well-formedness rules require attribute quotes.
Debugging a specific XML issue? Browse XML troubleshooting.