数据库A包含每个城市及其体育场的足球俱乐部和板球俱乐部列表。我为给定的本体编写了一个模糊的XML结构。但是结构中存在错误。我无法找到错误。 XML.Can有人指出这个错误吗?
<?xml version='1.0'?>
<City>
<Name>London</Name>
<Football_clubs>
<club_details>
<name>Chelsea FC</name>
<stadium>Stamford Bridge</stadium>
</club_details>
<club_details>
<name>Fulham</name>
<stadium>Craven Cottage</stadium>
</club_details>
<club_details>
<name>Spurs</name>
<stadium>WHL</stadium>
</club_details>
</Football_clubs>
<Cricket_Clubs>
<club_details>
<name>Yorkshire</name>
<stadium>XYZ</stadium>
</club_details>
<club_details>
<name>Leicetshire</name>
<stadium>ABC</stadium>
</club_details>
<club_details>
<name>Surrey</name>
<stadium>GHI</stadium>
</club_details>
</Cricket_Clubs>
</City>
<City>
<Name>Manchester</Name>
<Football_clubs>
<club_details>
<name>Manchester Utd</name>
<stadium>Old Trafford</stadium>
</club_details>
<club_details>
<name>Manchester City</name>
<stadium>Maine Road</stadium>
</club_details>
<club_details>
<name>Bolton</name>
<stadium>SDF</stadium>
</club_details>
</Football_clubs>
<Cricket_Clubs>
<club_details>
<name>Yorkshire</name>
<stadium>XYZ</stadium>
</club_details>
<club_details>
<name>Leicetshire</name>
<stadium>ABC</stadium>
</club_details>
<club_details>
<name>Surrey</name>
<stadium>GHI</stadium>
</club_details>
</Cricket_Clubs>
</City>
答案 0 :(得分:2)
肯定错过了根元素:
“每个XML文档都只有一个根元素。这个元素也称为文档元素。它包含所有其他元素,因此是所有其他元素的唯一父元素。” - 维基
应该是:
<?xml version='1.0'?>
<cities>
<city>
...contents
</city>
<city>
...contents
</city>
</cities>