My XML is a bit rusty, but I'm trying to create a local weather web-based api in XML. It is not finished however, but I have run into an error whilst testing it out, which is
error on line 3 at column 16: AttValue: " or ' expected.
My code:
<local_weather>
<local_counties>
<county id = 1>
<name> Suffolk </name>
<location>
api.openweathermap.org/data/2.5/weather?q=Ipswich,uk&APPID=6ce0e1da2bbce97fe9e735c3a2009c71
</location>
<name> Norfolk </name>
<location>
api.openweathermap.org/data/2.5/weather?q=Norwich,uk&APPID=da4be448d33cb1b0d8b5bdaa4daca4f7
</location>
<name> Essex </name>
<location>
api.openweathermap.org/data/2.5/weather?q=Chelmsford,uk&APPID&APPID=9fa167ffbd810a6cdbf0fe73597d92fe
</location>
<name> Cambridgeshire </name>
<location>
api.openweathermap.org/data/2.5/weather?q=Peterborough,uk&APPID&APPID=2dcefd34930d723d95c0c3d910f90c3d
</location>
</local_counties>
</local_weather>
There are three corrections necessary to make your XML well-formed:
<county id= 1 >
to <county id="1">
. county
.&
with &
.Here is your XML corrected to be well-formed:
<local_weather>
<local_counties>
<county id ="1">
<name> Suffolk </name>
<location>
api.openweathermap.org/data/2.5/weather?q=Ipswich,uk&APPID=6ce0e1da2bbce97fe9e735c3a2009c71
</location>
<name> Norfolk </name>
<location>
api.openweathermap.org/data/2.5/weather?q=Norwich,uk&APPID=da4be448d33cb1b0d8b5bdaa4daca4f7
</location>
<name> Essex </name>
<location>
api.openweathermap.org/data/2.5/weather?q=Chelmsford,uk&APPID&APPID=9fa167ffbd810a6cdbf0fe73597d92fe
</location>
<name> Cambridgeshire </name>
<location>
api.openweathermap.org/data/2.5/weather?q=Peterborough,uk&APPID&APPID=2dcefd34930d723d95c0c3d910f90c3d
</location>
</county>
</local_counties>
</local_weather>
You need to wrap the value of your id
attribute with a single or double quote.
<county id="1">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With