Answered You can hire a professional tutor to get the answer.

QUESTION

this lab is optional because its premise is flawed.

Note: this lab is optional because its premise is flawed. If you can fix the flawed premise, which involves modifying the starter files, you can receive extra credit, to replace another lab or case assignment. You have until the end of the term to take advantage of the opportunity.ScenarioAlberto Delgado, the manager of the Superstar Movies video store, is attempting to use XML to develop a catalog of all of the stores’ information about movies and actors. Alberto has already developed a way to structure an XML document of this type, and he has given you a sample file that uses this structure. However, he is worried that he and the other employees may fail to enter catalog entries in a consistent manner. Initially, he considered using a DTD to validate catalog documents, but he has recently learned that XML Schema enables more precise validation. Therefore, he has asked you to help him develop a schema for the catalog. You will construct two XML Schema documents: one for a library of user-defined data types, and one for the catalog itself.TasksUsing your preferred text editor, open catalogtxt.xsd, libtxt.xsd, and catalogtxt.xml from where ever you've saved them. Enter your name and the date in the comment section of each file and save them as catalog.xsd, lib.xsd, and catalog.xml respectively.Go to the lib.xsd file in your text editor. Within this schema you’ll create a library of data types. Add the root schema element and insert the declaration for the XML Schema namespace using the xs prefix. Set the default namespace and target of the schema to the URI http://www.superstarmovies.com/library.Create the following data types:actorID, based on the ID data type and following the pattern a####, where # is any digit (e.g., “a0101”)actorIDREF, based on the IDREF data type and following the same pattern as the actorID typemovieID, based on the ID data type and following the pattern m####–###, where # is any digit (e.g., “m1996-101”)movieIDREF, based on the IDREF data type and following the same pattern as the movieID typerankType, based on the integer data type and with values between 1 and 50 inclusiveCreate a list type named actorIDREFlist for lists that contain values of type actorIDREFCreate the following enumerated types, both of which are based on the string type:yes_no, which has possible values “yes” and “no”genreType, which has possible values “action”, “comedy”, “drama” and “fantasy”Create a complex type named roleType for an empty element with two attributes, both of which are required:character, which has the string typemovie, which has the movieIDREF typeClose the lib.xsd file, saving your changes and go to the catalog.xsd file in your text editor. Within this file you’ll create the schema for the catalog of movie and actor data.Insert the root schema element, declaring the XML Schema namespace with the xs prefix. Declare the library namespace using the URI http://www.superstarmovies.com/library and the prefix lib. Set the default namespace and the schema target to the URI http://www.superstarmovies.com/catalog.Import the lib.xsd schema file using the URI of the library namespace.Insert a declaration for the complex type element catalog. This element can contain an arbitrary number (possibly 0) of actor and/or movie child elements, in any order. You should use a flat catalog design, and thus the declarations of the child elements should not be included within the scope of the catalog element’s declaration. Rather, you should employ references to the declarations of these elements.The actor element is also a complex type element containing the following sequence of child elements: name, date, and birthplace, followed by one or more role elements. It also has the attributes id and oscarWinner. The date and birthplace elements are optional, as is the oscarWinner attribute; the id attribute is required. The oscarWinner attribute should have a default value of “no”.12. Set the data types of the elements and attributes of the actor element as follows:The name and birthplace elements contain string data.The date element contains dates of the form yyyy-mm-dd.The role element is of type roleType (taken from the library namespace).The id attribute contains actorID data (taken from the library namespace).The oscarWinner attribute contains yes_no data (taken from the library namespace).The movie element is also a complex type element containing the following sequence of child elements: title, year, length, and topBilledActors. It also has the required attributes id and genre, and the optional attribute earningsRank.14. Set the data types of the elements and attributes of the movie element as follows:The title element contains string data.The year element contains a year of the form yyyy.The length element contains a duration of the form hh:mm:ss.The topBilledActors element contains actorIDREFlist data (taken from the library namespace).The id attribute contains movieID data (taken from the library namespace).The genre attribute contains genreType data (taken from the library namespace).The earningsRank attribute contains rankType data (taken from the library namespace).Close the file, saving your changes; and then go to the catalog.xml file in your text editor.Within the root catalog element, declare the XML Schema instance namespace using the prefix xsi. Declare the catalog namespace using the prefix catalog. Attach the schema from the catalog.xsd file using the appropriate namespace.Change the opening and closing tags of the catalog element to a qualified name using the catalog prefix.Save your changes to the catalog.xml file and validate using XML Copy Editor (see Assorted Goodies, next page) or another validating parser. Correct any reported errors to make the document valid.19. Post a zipped/compressed file containing all your Lab files to the Lab Assignment link in the Week Four Assignments folder.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question