3

I have encountered another error with my XML. When I try to compile my XML, I get the error

error on line 7 at column 64: EntityRef: expecting ';'"

I do have it included but for some reason it keeps showing me this.

Here is my code:

<local_weather>
    <local_counties>
        <county id="1">
            <name> Suffolk </name>
            <title> Current Weather Listed </title>
            <location>
                api.openweathermap.org/data/2.5/weather?q=Ipswich,uk&APPID=6ce0e1da2bbce97fe9e735c3a2009c71; 
            </location>
            <name> Norfolk </name>
            <title> Current Weather Listed </title>
            <location>
                api.openweathermap.org/data/2.5/weather?q=Norwich,uk&APPID=da4be448d33cb1b0d8b5bdaa4daca4f7;
            </location>
            <name> Essex </name>
            <title> Current Weather Listed </title>
            <location>
                api.openweathermap.org/data/2.5/weather?q=Chelmsford,uk&APPID&APPID=9fa167ffbd810a6cdbf0fe73597d92fe;
            </location>
            <name> Cambridgeshire </name>
            <title> Current Weather Listed </title>
            <location>
                api.openweathermap.org/data/2.5/weather?q=Peterborough,uk&APPID&APPID=2dcefd34930d723d95c0c3d910f90c3d;
            </location>
        </county>
  </local_counties>
</local_weather>
kjhughes
  • 106,133
  • 27
  • 181
  • 240
Sam
  • 113
  • 1
  • 2
  • 7

2 Answers2

5

You must replace & with &amp; in order for your XML to be well-formed.

(This was correction #3 in the answer you accepted to your previous question about this XML. Why not use the fully corrected XML posted in that answer?)

Community
  • 1
  • 1
kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • I just tried that but I keep getting the same error for some reason. – Sam Sep 21 '16 at 18:02
  • Did you get ***all*** of the `&` characters? I suggest you copy and paste the [corrected XML in my earlier answer](http://stackoverflow.com/a/39620951/290085) so you're sure not to miss any of the many corrections I made there. – kjhughes Sep 21 '16 at 18:03
  • I just copied what you pasted on the other question, but I still get the same error. – Sam Sep 21 '16 at 18:06
  • 1
    Never mind, It works now. Thanks :) – Sam Sep 21 '16 at 18:07
1

You can not have & in xml. it has to be escaped. replace your & with &amp; in your xml and try.

Deendayal Garg
  • 5,030
  • 2
  • 19
  • 33