Introduction to XML

| HOME | SYLLABUS | CALENDAR AND EXERCISES |

More about XML structures 

Practice 2a: XML phonebook 

Below you see an extract from a phone book. Plan XML markup that has as much information as possible. Try to make the solution general so that it allows one person to have two or more numbers (home, GSM, summer residence), and two people to share one number (family members).

Landtman Ilse Mrs
- 6F South Street ...............................04 64 88 76 65
- Summer residence: Les petits bois....... 06 27 24 51 66
Lane Paula and Henry
- 25 Willow street ...............................04 29 90 33 92 
- Henry GSM ...........................................050 2155333
Laner Anja
- East village.......................................04 87 97 22 12
Laner Georges
- 11 North Avenue ............................04 87 23 77 36
- GSM ...........................................050 222333

Explanations for the above:
Landtman, Lane, Laner are last names;
Ilse, Paula, Henry, Anja, Georges are first names

Practice 2b: designing an XML structure for a restaurant menu

A restaurant chain plans to post its menu options on WEB for direct ordering, and needs a simple but easy-to-update solution. Draft an XML markup which would include the dishes, beverages, combo menues etc. in a flexible manner.

Practice 2c: Compare XML tree structures and the relational model

You have a course enrollment database in relational form. Plan an XML model that could be used for transferring the information to some other application. There are three tables: Students, Courses and Registrations, here is some example content, add more.

Student ID Student name Group
33004 Anna Miao IT03
33005 Cherry Hao IT03
34006 Julian Smith ME04

Course ID Course name Department
4EN Advanced English Languages
2DB Database systems Information Technology
9PR Programming in Java Information Technology

Registration Student ID Course ID
1199444 34006 4EN
1199445 33005 9PR
1199446 34006 9PR

| HOME | SYLLABUS | CALENDAR AND EXERCISES |

Created by: Jaana Holvikivi
Updated: 23.1.2009