I am working on an assignment where I create DVD database in XML and validate it with a DTD. I believe that I have accomplished this, but I would like someone to look at it and tell me if you see any issues. So far, everything validates fine, in other words no errors when displayed in an Internet Explorer window. However, I would like to make sure that I am hitting the right points.
<!--DVDs Private External DTD for Validating DVDs.xml-->
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT DVDs (DVD)+>
<!ELEMENT DVD (title, genre, movieRating, viewerRating, summary, year, director, runtime, studio, actors)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT genre (#PCDATA)>
<!ATTLIST genre kind (action | comedy | drama | family | foreign | horror | musical | other) #REQUIRED >
<!ELEMENT movieRating (#PCDATA)>
<!ATTLIST movieRating rating (G | PG | PG-13 | R | NC-17) #REQUIRED >
<!ELEMENT viewerRating (#PCDATA)>
<!ATTLIST viewerRating rating (1 | 2 | 3 | 4 | 5) #REQUIRED >
<!ELEMENT summary (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT director (#PCDATA)>
<!ELEMENT runtime (#PCDATA)>
<!ELEMENT studio (#PCDATA)>
<!ELEMENT actors (actor)+>
<!ELEMENT actor (first, last)>
<!ELEMENT actor (#PCDATA)>
<!ELEMENT first (#PCDATA)>
<!ELEMENT last (#PCDATA)>
<!ATTLIST actor idnum CDATA #REQUIRED >
<?xml version="1.0" encoding="UTF-8" ?>
<!-- DVDs.dtd can be found in the same directory as DVDs.xml -->
<!DOCTYPE DVDs SYSTEM "DVDS.dtd">
<title>Star Wars Episode IV: A New Hope</title>
<summary>Young hero Luke Skywalker joins the Rebel Alliance to help overthrow the tyrannical Galactic Empire.
<studio>20th Century Fox</studio>
<!-- Rest of DVDs omitted for brevity's sake -->
Main points that I am concerned about:
1) 'movieRatings' should only be one of the choices in the enumerated list (G, PG, etc.). When I tried to enter a different value in the xml file, it still validated in the Internet Explorer window (i.e. no errors). I thought it would fly unless it was one of the predetermined choices?
2) Although it does not specify in the assignment description, I would like to do something similar with 'viewerRating'. In other words, only a number of 1 to 5 may be entered.
3) Each actor has to have their first and last name listed and is to have a unique identifier. I think I did it right but would like to be sure.
Any and all suggestions, comments or observations are welcome. Thanks in advance!