How can I escape "&" in XML?
XmlXml Problem Overview
I write
<string name="magazine">Newspaper & Magazines</string>
in file strings.xml.
But the compiler says:
> The entity name must immediately follow the '&' in the entity reference. strings.xml /OOReaderWidget/res/values line 9 Android XML Format Problem
How can I show a "&" in strings.xml?
Xml Solutions
Solution 1 - Xml
Use &
in place of &
.
Change it to:
<string name="magazine">Newspaper & Magazines</string>
Solution 2 - Xml
& → &
< → <
> → >
Solution 3 - Xml
You can use &
in place of &