13

i have made a string named info_data as follows

<string name="info_address">SVG Service Verlags GmbH & Co. KG\n
    Schwertfegerstra?e 1-3\n
    D-23556 L?beck\n
</string>

i am getting an xml error saying that

Multiple annotations found at this line: - The entity name must immediately follow the '&' in the entity reference. - error: Error parsing XML: not well-formed (invalid token)

this error comes on the first line containing the &.

what is going wrong and how do i fix it.

thank you in advance.

4 Answers 4

45

You can't use the & sign. Try &amp; (I haven't tested it but it may work).

Sign up to request clarification or add additional context in comments.

Comments

5

I believe you will need to change the & to &amp;.

Comments

3
<string
        name="info_address">SVG Service Verlags GmbH &amp; Co. KG\n Schwertfegerstra?e 1-3\n
        D-23556 L?beck\n</string>

copy paste the code i have pasted. use this string use &amp; instead of &

Comments

3

While other answers about the ampersand may be correct, I don't think its just that.

This should be of some use.

Where an attribute value is a string, double backslashes ('\') must be used to escape characters — for example, '\n' for a newline or '\uxxxx' for a Unicode character.

You have \n, which may need to be \\n in addition to the change to the &

3 Comments

You should replace the \n with \\n, and put &amp; in place of the &
can't someone before you said the same thing. i gotta mark his answer because it came first.
Did you not also need to escape the newline?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.