In: Computer Science
Exercise 1:
Write an XML document describing the exercises in this document: the root element is <exercises>. The root has an attribute number that has value 1. The root element has three child elements; <date> that contains as text the date of the exercise, and two <item> elements for the first two exercises (1--2). Write some text in the <item> elements.
Exercise 2:
Write an XML document describing a person: name, occupation, address and hobbies. Please do not use your own information, you can use fake data. Decide on suitable element names and nesting. Check your document for well-formedness.
Exercise 3:
Draw a tree that represents the XML document you created in task 2.
Exercise 4:
This is the books.xml file
<?xml version='1.0'?>
<!-- This file represents a fragment of a book store inventory
database -->
<bookstore>
<book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin
Franklin</title>
<author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<price>8.99</price>
</book>
<book genre="novel" publicationdate="1967" ISBN="0-201-63361-2">
<title>The Confidence Man</title>
<author>
<first-name>Herman</first-name>
<last-name>Melville</last-name>
</author>
<price>11.99</price>
</book>
<book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
<title>The Gorgias</title>
<author>
<name>Plato</name>
</author>
<price>9.99</price>
</book>
</bookstore>
Using books.xml as a model, create a small xml file for a student's
program of study form called programOfStudy.xml. It should capture
the following data:
Exercise 1:
<?xml versio="1.0" encoding="UTF-8"?>
<exercises>
<date> 23-12-2019 </date>
<item1> message1 </item1>
<item2> message1 </item2>
</exercises>
Exercise 2:
<?xml version="1.0" encoding="UTF-8"?>
<person>
<name><gname>Anony</gname><fname>Heinonen</fname></name>
<occup>assistant</occup>
<address>
<affil>Harvard University, Dept. of Computer
Science</affil>
<pbox>P.O. Box 68</pbox><street>Gustaf
Hällströmin katu 2b</street>
<pcode>FI-00014</pcode><plocale>Harvard
University </plocale>
</address>
<hobbies><hobby>eating</hobby><hobby>sleeping</hobby></hobbies>
</person>
Exercise 3: