Xml 验证失败
我创建了一个非常简单的 xml 文件来存储高分,但 validome.org 说它无效,我不明白为什么。
这是 xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HighScoreList [
<!ELEMENT HighScoreList (Highscore*)>
<!ELEMENT HighScore (Name, Score)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Score (#PCDATA)>
]>
<HighScoreList>
<HighScore>
<Name>Player</Name>
<Score>1000</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>900</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>800</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>700</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>600</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>500</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>400</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>300</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>200</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>100</Score>
</HighScore>
</HighScoreList>
错误(在最后一行):
元素类型“HighScoreList”的内容必须匹配“(Highscore*)”。
I created a very simple xml file to store highscores, but validome.org says it isn't valid, and i can't figure out why.
Here is the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HighScoreList [
<!ELEMENT HighScoreList (Highscore*)>
<!ELEMENT HighScore (Name, Score)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Score (#PCDATA)>
]>
<HighScoreList>
<HighScore>
<Name>Player</Name>
<Score>1000</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>900</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>800</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>700</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>600</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>500</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>400</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>300</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>200</Score>
</HighScore>
<HighScore>
<Name>Player</Name>
<Score>100</Score>
</HighScore>
</HighScoreList>
And the error (at the last line):
Content of element type "HighScoreList" must match "(Highscore*)".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有两种不同的拼写,
Highscore
和HighScore
(注意大写和小写的S
)。You have two different spellings,
Highscore
andHighScore
(note the capital and lowercaseS
).