如何纠正标签不匹配错误?

How to correct a tag mismatch error?

我已经创建了一个 network xml 文件来解析成 Java 应用程序。但是当我验证 xml 文件时出现以下错误:

"Line 71, Column 14: end tag for element "location" 未开放"

为了对此进行调试,我检查了我的开始和结束标签,但没有发现任何错误。

谁能找出标签错误的地方?

<?xml version="1.0" encoding="UTF-8"?>
<network>
  <locations>
   <location>
    <location name="Tiberius"/>
    <location description="You are in the Kingdom of Tiberias at the start of your journey.."/>
    <objects>
        <object type = "sword" life = "-0.5"/>
        <object type = "food" life = "+0.5"/>
        <object type = "medicine" life = "+1.0"/>
        <object type = "ale" life = "+0.2"/>
        <object type = "shield" life = "+0.4"/>
    </objects>
    <character>
        <character type = "Saracen" life = "10"/>
        <character type = "Knights Hospitaller" life = "10"/>
        <character type = "Knights Templar" life = "10"/>
        <character type = "Principality of Antioch" life = "10"/>
        <character type = "Order of Saint" life = "10"/>
        <character type = "Lazarus" life = "10"/>
        <character type = "Ayyubids" life = "10"/>
    </character>
    <exits>
        <exit name="Jerusalem" direction="S"/>
    </exits>
   </location>
   <location>
    <location name="Jerusalem"/>
    <location description="You are in the Kingdom of Jerusalem.."/>
    <objects>
        <object type = "sword" life = "-0.5"/>
        <object type = "food" life = "+0.5"/>
        <object type = "medicine" life = "+1.0"/>
        <object type = "ale" life = "+0.2"/>
        <object type = "shield" life = "+0.4"/>
    </objects>
    <character>
        <character type = "Saracen" life = "10"/>
        <character type = "Knights Hospitaller" life = "10"/>
        <character type = "Knights Templar" life = "10"/>
        <character type = "Principality of Antioch" life = "10"/>
        <character type = "Order of Saint" life = "10"/>
        <character type = "Lazarus" life = "10"/>
        <character type = "Ayyubids" life = "10"/>
    </character>
    <exits>
        <exit name="Lod" direction="W"/>
    </exits>
   </location>
   <location name="Lod"/>
    <location description="You are in the Kingdom of Lod.."/>
    <objects>
        <object type = "sword" life = "-0.5"/>
        <object type = "food" life = "+0.5"/>
        <object type = "medicine" life = "+1.0"/>
        <object type = "ale" life = "+0.2"/>
        <object type = "shield" life = "+0.4"/>
    </objects>
    <character>
        <character type = "Saracen" life = "10"/>
        <character type = "Knights Hospitaller" life = "10"/>
        <character type = "Knights Templar" life = "10"/>
        <character type = "Principality of Antioch" life = "10"/>
        <character type = "Order of Saint" life = "10"/>
        <character type = "Lazarus" life = "10"/>
        <character type = "Ayyubids" life = "10"/>
    </character>
    <exits>
        <exit name="Haifa" direction="N"/>
    </exits>
   </location>
  </locations>
  <edges>
   <edge>
    <edge direction="S" from = "Tiberius" to="Jerusalem" weight="10" danger="7"/> 
   </edge>
   <edge>
    <edge direction="W" from = "Jerusalem" to="Lod" weight="8" danger="10"/> 
   </edge>
   <edge>
    <edge direction="N" from = "Lod" to="Haifa" weight="23" danger="5"/> 
   </edge>
  </edges>
</network>

在此行的顶部 <location name="Lod"/> 添加开始标记 <location>,希望这能解决您的问题。如果您需要任何帮助,请告诉我