Assignment Unit 6 by Waseem U Zaman
Assignment Unit 6 by Waseem U Zaman
Exercise 1: Write an XML document describing the exercises in this document: the root element is . The
root has an attribute number that has value 1. The root element has three child elements; that contains
as text the date of the exercise, and two elements for the first two exercises (1 – 2). Write some text in
the elements.
<exercise>
</exercise>
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.
Answer to Exercise 2:
<person>
<name>
<firstname> Aquib</firstname>
<lastname>White</lastname>
</name>
<occupation>painter</occupation>
<address>
<street>bemina</street>
<area>chowk</area>
<city>srinagar</city>
<country>India</country>
<postalcode>190018</postalcode>
</address>
<hobbies>
<hobby>prayers</hobby>
<hobby>Cooking</hobby>
<hobby>Cleaning</hobby>
</hobbies>
</person>
Answer to Exercise 4:
<studentsprogram>
<program year="2008" semester="Fall">
<class>
<goal> 8 </goal>
<course2>ECON 201</course2>
<goal> 11 </goal>
</class>
<majors>
</majors>
</program>
<major>
</major>
</program>
</studentsprogram>