Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
MBUS676BUSN490 E-Commerce Spring 2006, Professor Chen Name: ______________ Due Date: ___________ Hamlet Assignment with XML One of the great Jesuit Universities, Gonzaga University now includes several world-class undergraduate and graduate programs. Professor David Teagarden is a member of the award-winning English department at GU. And, he is working on a Web site devoted to the work and life of William Shakespeare. He has created a document detailing the acts and scenes of Hamlet and has asked your help in placing this data in XML form. To complete this task: 1. Start your text editor and open the Hamlet.txt file (see Figure 1 and it will be provided by your instructor). Save the document as Hamlet.xml. 2. Create a prolog at the top of the document, indicating that this is an XML document-using version 1.0 of XML. You do not need to include any other information in the XML declaration. 3. Enclose the entire document content in a root element named "Play." 4. Place the title of the play in a root element named "Title". 5. Add an attribute to the Title element named "type." Set the value of the type attribute to "Tragedy." 6. Place the summary of the place in a CDATA section within an element named "Summary." 7. Place all of the information about each act of the play within an element named "Act." Place the name of each act (Act 1, Act 2, and so forth) within an element named "Act_Number." 8. Place all of the information about each scene of the play within an element named "Scene." Place the name of each scene (Scene i, Scene ii, and so forth) within an element named "Scene_Number." Place the location of each scene within an element named "Location." 9. Create a processing instruction to access the Plays.css style sheet (see Figure 2) when a Web browser accesses this document. 10. See a sample output in Figure 3 11. Print your XML code and save your changes. 12. Open the Hamlet.xml document in your Web browser. Print the pages as they/are rendered by the browser. What you have to turn in: a. Hand in your printouts (Hamlet.xml and its output on the Web) b. Email with two attachments of Hamlet.xml and Plays.css to your instructor at [email protected] Figure 1. Hamlet.txt Hamlet One of the greatest stories ever written in the English language, Hamlet is the story of a young Danish prince who finds out from the ghost of his father (the king) that his uncle killed the king and married the queen. Filled with grief and the desire for revenge, Hamlet delays action. He is also in love with a courtier's daughter, Ophelia, but is so affected by his mother's treachery that he tells Ophelia to go to a nunnery and that he does not support marriage. He hires a theater troupe to stage a play that re-enacts the events of his father's death to study his uncle's reaction and determine his guilt; later events in the story surround attempts by the new king to have his nephew killed. Hamlet ends in tragedy but with the promise of immortality for Hamlet through his soldier's funeral and the recording of his story by his friend Horatio. Act 1 Scene i: Elsinore. A platform before the castle. Scene ii: A room of state in the castle. Scene iii: A room in Polonius' house. Scene iv: The platform. Figure 2. DTD file of Plays.css (style sheet) Scene v: Another part of the platform. Play {font-family: Times New Roman; font-size:12pt} Act 2 Scene i: A room in POLONIUS' house. Scene ii: A room in the castle. Summary {display:block} Title {font-family: Arial, Helvetica, Sans-serif; font-size:24pt; color:blue; font-weight:bold; display:block; margin-bottom:15pt} Act 3 Scene i: A room in the castle. Scene ii: A hall in the castle. Scene iii: A room in the castle. Scene iv: The Queen's closet. Act {display:block; margin-top:15pt} Act_Number{font-weight:bold; color:blue; font-family:Arial, Helvetica, Sans-serif} Scene {display:list-item; margin-left:15pt; list-style-type:square} Scene_Number{font-weight:bold} Act 4 Scene i: A room in the castle. Scene ii: Another room in the castle. Scene iii: Another room in the castle. Scene iv: A plain in Denmark. Scene v: Elsinore. A room in the castle. Scene vi: Another room in the castle. Scene vii: Another room in the castle. XML HW (Hamlet), Page-2 Figure 3: Sample output of Hamlet XML HW (Hamlet), Page-3