0% found this document useful (0 votes)
20 views4 pages

TP N°1- XML-2024

The document outlines a practical work assignment for a computer science course focusing on XML concepts. It includes exercises for creating XML documents, verifying their well-formedness and validity against DTDs, and modeling various data structures such as personal directories and academic systems. Additionally, it provides tasks for correcting XML errors and designing DTDs for specific XML documents.

Uploaded by

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

TP N°1- XML-2024

The document outlines a practical work assignment for a computer science course focusing on XML concepts. It includes exercises for creating XML documents, verifying their well-formedness and validity against DTDs, and modeling various data structures such as personal directories and academic systems. Additionally, it provides tasks for correcting XML errors and designing DTDs for specific XML documents.

Uploaded by

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

3rd year computer science Mohamed Chérif Messaadia

Semi-structured data University


Practical work 2022-2023

TP N°1 Basic XML concepts

Exercise 1:
The goal of this exercise is to create an XML document structuring
the data in a directory. This directory must include at least 2 people.
For each person we would like to know the following information:

 their gender (man or woman);

 his first name;

 his last name;

 his address;

 one or more telephone numbers (mobile phone or office);

 one or more e-mail addresses (personal, professional address).

a. Verify that your document is well-formed using an XML editor.


b. View your document on an Internet browser
Exercise 2: Write an XML document modeling your Curriculum Vitae. A CV should
contain the following information:
 Contact details: first name, last name, address, date of birth,
telephone number and email
 Training: diploma, year, location and mention
 The experiences: wording, year and place
 Computer skills: programming language, DBMS, IDE and OS

Write the associated DTD and verify that your XML document is valid

against this DTD.


Exercise 3:
An academy wishes to manage courses taught in several colleges.
For this, we have the following information:
 Each college has a website
 Each college is structured into departments, which each bring
together specific teachers. Among these teachers, one of them
is responsible for the department.
 A teacher is defined by his last name, first name, telephone
number, email, date of taking up his position and his index.
 Each teacher only teaches one subject.
 Students take several subjects and receive a grade for each of
them.
 For each student, we want to manage their last name, first
name, telephone number, email, as well as their year of entry
into college.
 A subject can be taught by several teachers but always takes
place in the same classroom (each having a determined
number of places).
Questions :
1. Write an XML document modeling this system.
2. Write the associated DTD and verify that your XML
document is valid against this DTD.

Exercise 4:

Consider the following DTD which allows you to write documents representing people:

<!ELEMENT person (firstname, last name+, tel?, address) >


<!ELEMENT firstname (#PCDATA) >
<!ELEMENT lastname (#PCDATA) >
<!ELEMENT tel (#PCDATA) >
<!ELEMENT address (ANY) >

- For each of the following XML documents, determine if it is well-formed, valid and correct
any errors
<person>
<person>
<firstname>Bennani</firstname>
<firstname>Bennani</firstname>
<lastname>Mohammed</lastname>
<lastname>Mohammed</lastname>
<lastname>Ali</lastname>
<lastname>Ali</lastname>
<tel>0683000000</tel>
<telephone>0683000000</tel>
<email>[email protected]</email>
<address><city> S.Ahras </address></city>
<address>S.Ahras</address>
</person>
</person>

Exercise 5 :
- Create an XML schema repertoire.xsd from the xml document
created in exercise 1.

Exercise 6 :
Consider the following xml document:

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


<carnet>
<entite>
<identifiant>
<prenom>Johnny</prenom>
<nom>Begood</nom>
</identifiant>
<adresse>
<numero>121</numero>
<rue>rue Plein Ciel</rue>
<ville>N<ancy</ville>
<cpostal>54000</cpostal>
</adresse>
</entite>
<entite>
<identifiant>
<nom_societe> Lucid-it</nom_societe>
</identifiant>
<adresse>
<numero>14</numero>
<rue> boulevard du 21ème R.A.</rue>
<complement> Le Carré Rive Gauche</complement>
<ville>Nancy</ville>
<cpostal>54000</cpostal>
</adresse>
</entite>
</carnet>
Design a DTD validating this XML document.

You might also like