Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Scenario

Alberto 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.

Tasks

1. Using 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.

2. 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.

3. 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 type

• movieID, 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 type

• rankType, based on the integer data type and with values between 1 and 50 inclusive

4. Create a list type named actorIDREFlist for lists that contain values of type actorIDREF

5. Create 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"

6. Create a complex type named roleType for an empty element with two attributes, both of which are required:

• character, which has the string type

• movie, which has the movieIDREF type

7. Close 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.

8. 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.

9. Import the lib.xsd schema file using the URI of the library namespace.

10. 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.

11. 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).

13. 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).

15. Close the file, saving your changes; and then go to the catalog.xml file in your text editor.

16. 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.

17. Change the opening and closing tags of the catalog element to a qualified name using the catalog prefix.

18. 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. 

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M993486

Have any Question?


Related Questions in Programming Language

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As