Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6063421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:09:50+00:00 2026-05-23T09:09:50+00:00

I would like to know which part is not correct? I fixed one but

  • 0

I would like to know which part is not correct? I fixed one but another comes back.

 <?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>
    <date>2001</date>
    <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">
    <title>Lord of the Rings: The Fellowship of the Ring</title>
    <date>2001</date>
    <length>178 minutes</length>
    <topBilledActors actorIDs="a0103"/>
</movie>
<movie movieID="m0107" genre="action" earningsRank="8">
    <title>Lord of the Rings: The Return of the King</title>
    <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">
    <title>Saving Private Ryan</title>
    <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">
    <title>Forrest Gump</title>
    <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">
    <title>Philadelphia</title>
    <date>1993</date>
    <length>125 minutes</length>
    <topBilledActors actorIDs="a0101 a0107"/>
</movie>
<movie movieID="m0106" genre="drama">
    <title>Apollo 13</title>
    <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>

Error that I am getting

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

DTD File

    SuperStar Movies' DTD for XML Catalog documents
    Author: Randy White
    Date:   6/28/2011

    Filename:         catalog.dtd
    -->

    <!ELEMENT catalog (movie|actor)*>

    <!ELEMENT movie (title, date,year,length,topBilledActors)>
    <!ELEMENT title (#PCDATA)>
    <!ELEMENT year (#PCDATA)>
    <!ELEMENT length (#PCDATA)>
    <!ELEMENT topBilledActors EMPTY>
     <!ATTLIST movie movieID ID #REQUIRED>
    <!ATTLIST movie genre (action|comedy|drama|fantasy) #REQUIRED>
    <!ATTLIST movie earningsRank CDATA #IMPLIED>
    <!ATTLIST topBilledActors actorIDs IDREFS #REQUIRED>

    <!ELEMENT actor (name, date?, birthplace?, role+)>
    <!ELEMENT name (#PCDATA)>
    <!ELEMENT date (#PCDATA)>
    <!ELEMENT birthplace (#PCDATA)>
     <!ELEMENT role EMPTY>
    <!ATTLIST actor actorID ID #REQUIRED>
    <!ATTLIST actor oscarWinner (yes|no) "no">
    <!ATTLIST role character CDATA #REQUIRED>
    <!ATTLIST role movie IDREF #REQUIRED>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:09:51+00:00Added an answer on May 23, 2026 at 9:09 am

    Looking at the DTD, I can see that movie has to have exactly one title, date, year, length, and topBilledActors (in that order).

    Some of your movie elements don’t contain all of the necessary elements. Either you need to fix the XML, or your DTD needs modifications.

    For example, the first movie element is missing a year:

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

    I would lean toward DTD modifications since you have multiple ATTLIST declarations for movie.

    This is how I would modify your DTD:

    <!ELEMENT catalog (movie|actor)*>
    
    <!ELEMENT movie (title?,date?,year?,length?,topBilledActors?)> 
    <!ATTLIST movie 
              movieID ID #REQUIRED 
              genre (action|comedy|drama|fantasy) #REQUIRED 
              earningsRank CDATA #IMPLIED> 
    
    <!ELEMENT topBilledActors EMPTY>
    <!ATTLIST topBilledActors 
              actorIDs IDREFS #REQUIRED>
    
    <!ELEMENT actor (name, date?, birthplace?, role+)>
    <!ATTLIST actor 
              actorID ID #REQUIRED
              oscarWinner (yes|no) "no">
    
    <!ELEMENT role EMPTY>
    <!ATTLIST role 
              character CDATA #REQUIRED
              movie IDREF #REQUIRED>
    
    <!ELEMENT title (#PCDATA)>
    <!ELEMENT year (#PCDATA)>
    <!ELEMENT length (#PCDATA)>
    <!ELEMENT name (#PCDATA)>
    <!ELEMENT date (#PCDATA)>
    <!ELEMENT birthplace (#PCDATA)>
    

    Notice that the children of movie are now optional (? = zero or one occurrence).

    Also notice how I merged the ATTLIST declarations and put them with their element declarations. Moving them just under the element declaration makes the DTD much easier to read.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know which dependency described in my pom.xml brings a transitive
I would like to know which one is the best material that I can
I've got an executable file, and I would like to know which version(s) of
I would like to know on how to detect on which part of the
this is a simple html question but I would like to know the correct
i would like to know , how ill know which inlines forms was edited?
I would like to know the procedure which will give the out put about
I would like to know where can I find the code which eclipse uses
I am creating an iphone performance app in which I would like to know
i would like know some reference. I know i can googling it. but prefer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.