为什么给我这个错误;StartTag:无效的元素名称";使用DTD解析此XML文件时

为什么给我这个错误;StartTag:无效的元素名称";使用DTD解析此XML文件时,xml,dtd-parsing,dtd,Xml,Dtd Parsing,Dtd,文档基本上以“catalog”作为根标记,子标记为“movie”,后跟一个或多个“actor”。每个子标记还包含更多的子标记。我本应该根据给定的一些规则为这个做一个DTD,但它只是拒绝我在doucment开始时所做的任何事情。有什么帮助吗 以下是XML代码: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE catalog SYSTEM "catalog.dtd"> <catal

文档基本上以“catalog”作为根标记,子标记为“movie”,后跟一个或多个“actor”。每个子标记还包含更多的子标记。我本应该根据给定的一些规则为这个做一个DTD,但它只是拒绝我在doucment开始时所做的任何事情。有什么帮助吗

以下是XML代码:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<!DOCTYPE catalog SYSTEM "catalog.dtd">

<catalog>
    <movie movieID="m0100" genre="drama">
    <title>Monster&apos;s Ball</title>
<year>2001</year> 
<length>111 minutes</length>
<topBilledActors actorIDs="a0100 a0102" />
</movie>

<actor actorID="a0100" oscarWinner="yes">
    <name>Halle Berry</name>
<date>August 14, 1966</date>
<birthplace>Cleveland, Ohio</birthplace>
<role character="Leticia Musgrove" movie="m0100" />
<role character="Storm" movie="m0101" />
</actor>

<actor actorID="a0102" oscarWinner="yes">
    <name>Billy Bob Thornton</name>
<role character="Hank Grotowski" movie="m0100" />
</actor>

<movie movieID="m0101" genre="fantasy">
    <title>X-Men</title>
<year>2000</year>
<length>104 minutes</length>
<topBilledActors actorIDs="a0100 a0103" />
</movie>

<actor actorID="a0103" oscarWinner="no">
    <name>Ian McKellen</name>
<role character="Magneto" movie="m0101" />
<role character="Gandolf" movie="m0105" />
<role character="Gandolf" movie="m0107" />
</actor>

<movie movieID="m0105" genre="action" earningsRank="17">
    <name>Lord of the Rings: The Fellowship of the Ring</name>
<date>2001</date>
<length>178 minutes</length>
<topBilledActors actorIDs="a0103" />
</movie>

<movie movieID="m0107" genre="action" earningsRank="8">
    <name>Lord of the Rings: The Return of the King</name>
<date>2003</date>
<length>201 minutes</length>
<topBilledActors actorIDs="a0103" />
</movie>

<actor actorID="a0101" oscarWinner="yes">
<name>Tom Hanks</name>
<date>July 9, 1956</date>
<birthplace>Concord, California</birthplace>
<role character="Captain John H. Miller" movie="m0102" />
<role character="Forrest Gump" movie="m0103" />
<role character="Andrew Beckett" movie="m0104" />
</actor>

<movie movieID="m0102" genre="action" earningsRank="50">
    <name>Saving Private Ryan</name>
<date>1998</date>
<length>170 minutes</length>
<topBilledActors actorIDs="a0101 a0104" />
</movie>

<actor actorID="a0104" oscarWinner="yes">
    <name>Matt Damon</name>
<date>October 8, 1970</date>
<birthplace>Cambridge, Massachusetts</birthplace>
<role character="Private James Francis Ryan" movie="m0102" />
</actor>

<movie movieID="m0103" genre="comedy" earningsRank="14">
    <name>Forrest Gump</name>
<date>1994</date>
<length>142 minutes</length>
<topBilledActors actorIDs="a0101 a0105 a0106" />
</movie>

<actor actorID="a0105" oscarWinner="yes">
    <name>Sally Field</name>
<birthplace>Pasadena, California</birthplace>
<role character="Mrs. Gump" movie="m0103" />
</actor>

<actor actorID="a0106">
    <name>Gary Sinise</name>
<role character="Lt. Dan Taylor" movie="m0103" />
<role character="Ken Mattingly" movie="m0106" />
</actor>

<movie movieID="m0104" genre="drama">
    <name>Philadelphia</name>
<date>1993</date>
<length>125 minutes</length>
<topBilledActors actorIDs="a0101 a0107" />
</movie>

<movie movieID="m0106" genre="drama">
    <name>Apollo 13</name>
<date>1995</date>
<length>140 minutes</length>
<topBilledActors actorIDs="a0101 a0106" />
</movie>

<actor actorID="a0107" oscarWinner="yes">
    <name>Denzel Washington</name>
<role character="Joe Miller" movie="m0104" />
</actor>

</catalog>

怪物&apos;s球
2001
111分钟

我的web浏览器(IE)不显示该文件,并给出错误信息:

Required white space was missing. Error processing resource 'file:///C:/Documents and        Settings/Administrator/Desktop/...

 <!ATTLIST topBilledActors ActorIDs IDREFS>
缺少所需的空白。处理资源“”时出错file:///C:/Documents 和设置/管理员/桌面/。。。

我认为您需要指定属性是“必需的”、“隐含的”还是“固定的”默认值,才能使DTD有效。您还应该有
不要使用w3schools。找一个更好的验证器。我也在使用XMLSpy,它给出了一个错误:无法通过'file:///C:/Documents%20and%20Settings/Administrator/Desktop/.../catalog.dtd'. '格式良好性冲突:字符“>”在语法上是意外的“W3和XML Spy都是糟糕的验证器”。使用
Required white space was missing. Error processing resource 'file:///C:/Documents and        Settings/Administrator/Desktop/...

 <!ATTLIST topBilledActors ActorIDs IDREFS>