0% found this document useful (0 votes)
29 views3 pages

Assignment Unit 6 by Waseem U Zaman

Uploaded by

waseem zaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views3 pages

Assignment Unit 6 by Waseem U Zaman

Uploaded by

waseem zaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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.

<?xml version="1.0" encoding="ISO-8859-1" ?>

<exercise>

<date>23 July 2023</date>

<item1>Start with XML</item1>

<item2>Write XML document</item2>

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

Check your document for well-formedness.

Answer to Exercise 2:

<?xml version="1.0" encoding="UTF-8"?>

<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:

<?xml version="1.0" encoding="UTF-8"?>

<!-- this file represents a student's study program -->

<studentsprogram>
<program year="2008" semester="Fall">

<class>

<course1> PHIL 101</course1>

<goal> 8 </goal>

<course2>ECON 201</course2>

<goal> 11 </goal>

</class>

<corecourse> MGT 217 </corecourse>

<majors>

<course1> CIS 120 </course1>

<course2> CIS 403 </course2>

</majors>

</program>

<program year="2009" semester="Spring">

<corecourse1> MGT 261 </corecourse1>

<corecourse2> MKTG 325 </corecourse2>

<major>

<course1> CIS 220 </course1>

<course2> CIS 407 </course2>

<course3> CIS 490 </course3>

</major>

</program>

</studentsprogram>

You might also like