Xml 验证失败

发布于 2024-12-25 17:32:15 字数 1529 浏览 1 评论 0原文

我创建了一个非常简单的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷清清 2025-01-01 17:32:15

您有两种不同的拼写,HighscoreHighScore(注意大写和小写的 S)。

You have two different spellings, Highscore and HighScore (note the capital and lowercase S).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文