2011-06-28 8 views
0
<?xml version="1.0" ?> 
<!-- 
Superstar Movies: Catalog of Movie and Actor Info. 
Author: Randy White 
Date: 6/28/2011 

Filename:   catalog.xml 
--> 

<!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> 

XML検証エラーです。どの部分が正しくないか知りたいですか?以下は

私は取得していますエラーです:

File C:\Users\Randy\Documents\XML\Week3\Solution Files\catalog.xml  is not valid. 
Content model of element 'movie' disallows element 'name' at this position. 
    Error location: catalog/movie/name 
    Details 
     VC: Element Valid: Content model of element 'movie' disallows element 'name' at this position. 
+0

あなたが検証するために、より良いツールを使用する必要があります。 – bmargulies

+0

それは役に立ちませんでした。 – user770022

+0

ああ、まあ、あなたはあなたがどんなツールを使っているか教えてくれませんでしたか?... – bmargulies

答えて

1

どこかで、あなたはおそらく置き換え誤って「名前」内部「映画」と「タイトル」属性

+0

それはそれの一部だった。もう1つは、dateの代わりに自分のdtdファイルで年を使用していたということでした。私はこれらの変更を行い、現在は機能しています。みんな助けてくれてありがとう。 – user770022

1

を開始するには:<catalog xml:lang="en"><catalog>を変更しようと最初の二つの後の端

+0

私はあなたの話に従いません。 – user770022

+0

ファイルC:¥Users¥Randy¥Documents¥XML¥Week3¥Solution Files¥catalog.xmlは無効です。要素 'カタログ'には 'xml:lang'という名前の属性の宣言はありません。エラー場所:カタログ/ @xml:lang詳細VC:属性値タイプ:要素 'カタログ'には 'xml:lang'という名前の属性の宣言がありません。 – user770022

+0

@ user770022 XMLファイルが不完全なため、catalgoのクローズタグが欠落していました。 @Thijsはおそらくそれを参照していた – Sai

1

</catalog>でそれを閉じます映画の場合、titleを使用する場合は、代わりにnameを使用します。

2

名前の代わりにタイトルを使用する必要がありますか?それがエラーを修正しない場合は、DTDを投稿できますか? 「ロードオブザリング」で始まるあなたのXMLファイルの途中で

関連する問題