gpt4 book ai didi

xml - XML错误:AttValue:应为 "or '

转载 作者:行者123 更新时间:2023-12-02 08:18:36 25 4
gpt4 key购买 nike

我的XML有点使用rust ,但是我试图用XML创建一个基于本地天气网络的api。但是还没有完成,但是在测试时遇到了错误,这是

error on line 3 at column 16: AttValue: " or ' expected.



我的代码:
<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>

最佳答案

要使您的XML well-formed ,需要进行三处更正:

  • <county id= 1 >更改为<county id="1">
  • county添加结束标记。
  • &替换&amp;


  • 这是您的XML,格式正确:
    <local_weather>
    <local_counties>
    <county id ="1">
    <name> Suffolk </name>
    <location>
    api.openweathermap.org/data/2.5/weather?q=Ipswich,uk&amp;APPID=6ce0e1da2bbce97fe9e735c3a2009c71
    </location>
    <name> Norfolk </name>
    <location>
    api.openweathermap.org/data/2.5/weather?q=Norwich,uk&amp;APPID=da4be448d33cb1b0d8b5bdaa4daca4f7
    </location>
    <name> Essex </name>
    <location>
    api.openweathermap.org/data/2.5/weather?q=Chelmsford,uk&amp;APPID&amp;APPID=9fa167ffbd810a6cdbf0fe73597d92fe
    </location>
    <name> Cambridgeshire </name>
    <location>
    api.openweathermap.org/data/2.5/weather?q=Peterborough,uk&amp;APPID&amp;APPID=2dcefd34930d723d95c0c3d910f90c3d
    </location>
    </county>
    </local_counties>
    </local_weather>

    关于xml - XML错误:AttValue:应为 "or ',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39620786/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com