Blnpwr
Blnpwr

Reputation: 1875

Android XML Parsing Error (invalid token, not well formed)

The "&" signs in the url from the following xml files throw errors when compiling in android studio. The error is that the line 5-7 (url line) in <DetailPageUrl> is not well formed (invalid token). I don't know why and I can't modify the url since I need it.

This is the xml

  <?xml version="1.0" encoding="UTF-8"?>
<Items>
<Item>
    <DetailPageURL>
        https://www.amazon.de/Chemie-76128-Felgenreiniger-Alu-Teufel-Spezial/dp/B004LAXG9C?psc=1**&**SubscriptionId=mykey**&**tag=mytag&linkCode=xm2**&**camp=2025&
        creative=165953**&**creativeASIN=B004LAXG9C
    </DetailPageURL>
    <URL>https://images-eu.ssl-images-amazon.com/images/I/412-16OaNFL._SL160_.jpg</URL>
    <Feature>Der neue "Alu-Teufel-Spezial"" ist ein moderner Hochleistungs-Felgenreiniger. Die
        neue, säurefreie Rezeptur ermöglicht die problemlose Reinigung von Stahl- und
        Aluminiumfelgen sowie Radkappen.
    </Feature>
    <FormattedPrice>EUR 13,50</FormattedPrice>
    <Title>Tuga Chemie 76128 Felgenreiniger Alu-Teufel Spezial</Title>

</Item>
</Items>

Upvotes: 1

Views: 555

Answers (1)

Calvin Iyer
Calvin Iyer

Reputation: 161

You need to replace the & with &amp; in your xml file.

You can refere the below link for a list of characters that need to be escaped in xml:

XML Character Escape List

Upvotes: 2

Related Questions