我的XML遇到了另一个错误。当我尝试编译我的XML时,我收到了错误
第64行第7行的错误:EntityRef:期待';'“
我确实已将它包括在内但由于某种原因它不断向我展示这一点。
这是我的代码:
<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>
答案 0 :(得分:2)
您必须将&
替换为$.getJSON
才能使XML格式正确。
(这是answer you accepted中previous question about this XML的修正#3。为什么不使用在该答案中发布的完全更正的XML?)
答案 1 :(得分:1)
xml中不能有&
。它必须逃脱。将您的&
替换为xml中的&
并尝试。