Quick answer
Attributes in XML must have a name, an equals sign, and a value in single or double quotes.
XML Invalid Attribute
Attributes in XML must have a name, an equals sign, and a value in single or double quotes. Invalid syntax or unclosed quotes cause parser errors.
Common causes
- Unclosed quote in an attribute value.
- Missing space between attributes or invalid character in attribute name.
- Attribute name or value that contains invalid characters.
How to fix
- Ensure every attribute value is in double or single quotes.
- Use only valid name characters for attribute names (letters, digits, hyphen, underscore, colon).
- Validate with an XML validator to get the exact line and column.
Examples
Bad
<el a=unquoted>
Good
<el a="value">
FAQ
- Can an XML attribute value contain a quote?
- Use the other quote for the value (e.g. attr="value with 'inside'" or attr='value with "inside"').
- Are XML attribute names case-sensitive?
- Yes. Attribute names are case-sensitive.
Fix it now
Try in validator (prefill this example)