MSc-IT Study Material
June 2010 Edition

Computer Science Department, University of Cape Town

Creating your own ML based on XML

Relational data, such as the set below, can be encoded into XML format as follows:

classCS&614
students3
marks
vusi12
john24
nithia36

This data could be encoded as shown below, although there are many other ways of doing this. Can you rewrite it differently?

<class>CS&amp;614</class>
<students>3</students>
<mark>
  <student_name>vusi</studentname>
  <mark_obtained>12</mark_obtained>
</mark>
<mark>
  <student_name>john</student_name>
  <mark_obtained>24</mark_obtained>
</mark>
<mark>
  <student_name>nithia</student_name>
  <mark_obtained>36</mark_obtained>
</mark>

Now encode the following in XML:

NameAgeOccupation
Tsepo20Student
James19Waiter
Molly27Executive