0% ont trouvé ce document utile (0 vote)
97 vues6 pages

TP1 Correction

Le document décrit plusieurs exercices sur la manipulation de documents XML, incluant la création et modification d'éléments, d'attributs, et de la structure d'un document. Les exercices proposent des exemples de documents XML représentant des livres, articles, et carnets d'adresses.

Transféré par

saad
Copyright
© © All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats DOCX, PDF, TXT ou lisez en ligne sur Scribd
0% ont trouvé ce document utile (0 vote)
97 vues6 pages

TP1 Correction

Le document décrit plusieurs exercices sur la manipulation de documents XML, incluant la création et modification d'éléments, d'attributs, et de la structure d'un document. Les exercices proposent des exemples de documents XML représentant des livres, articles, et carnets d'adresses.

Transféré par

saad
Copyright
© © All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats DOCX, PDF, TXT ou lisez en ligne sur Scribd

ÉCOLE DES SCIENCES DE L’INFORMATION Année universitaire 2022/2023

Département Génie des Données, 3ème année / GDV


des Contenus et des Connaissances Web Sémantique

TP N° 1
Exercice 1 :
<?xml version="1.0" encoding="iso-8859-1"?>
<livre>
<titre>Mon livre</titre>
<auteurs>
<auteur><nom>Brillant</nom><prenom>Alexandre</prenom></auteur>
<auteur><nom>Briand</nom><prenom>Aristide</prenom></auteur>
</auteurs>
<sections>
<section>
<titre>Section 1</titre>
<chapitres>
<chapitre>
<titre>Chapitre 1</titre>
<paragraphes>
<paragraphe>Premier paragraphe</paragraphe>
<paragraphe>Deuxième paragraphe</paragraphe>
</paragraphes>
</chapitre>
<chapitre>
<titre>Chapitre 2</titre>
<paragraphes>
<paragraphe>Premier paragraphe</paragraphe>
<paragraphe>Deuxième paragraphe</paragraphe>
</paragraphes>
</chapitre>
</chapitres>
</section>
<section>
<titre>Section 2</titre>
<chapitres>
<chapitre>
<titre>Chapitre 1</titre>
<paragraphes>
<paragraphe>Premier paragraphe</paragraphe>
<paragraphe>Deuxième paragraphe</paragraphe>
</paragraphes>
</chapitre>
<chapitre>
<titre>Chapitre 2</titre>
<paragraphes>
<paragraphe>Premier paragraphe</paragraphe>
<paragraphe>Deuxième paragraphe</paragraphe>
</paragraphes>
</chapitre>
</chapitres>
</section>
</sections>
</livre>

Exercice 2 :
<?xml version="1.0" encoding="iso-8859-1"?>
<livre titre="Mon livre">
<auteurs>
<auteur nom="Brillant" prenom="Alexandre"/>
<auteur nom="Briand" prenom="Aristide"/>
</auteurs>
<sections>
<section titre="Section 1">
<chapitre titre="Chapitre 1">
<paragraphe>Premier paragraphe</paragraphe>
<paragraphe>Deuxième paragraphe</paragraphe>
</chapitre>
<chapitre titre="Chapitre 2">
<paragraphe>Premier paragraphe</paragraphe>
<paragraphe>Deuxième paragraphe</paragraphe>
</chapitre>
</section>
<section titre="Section 2">
<chapitre titre="Chapitre1">
<paragraphe>Premier paragraphe</paragraphe>
<paragraphe>Deuxième paragraphe</paragraphe>
</chapitre>
<chapitre titre="Chapitre 2">
<paragraphe>Premier paragraphe</paragraphe>
<paragraphe>Deuxième paragraphe</paragraphe>
</chapitre>
</section>
</sections>
</livre>

Exercice 3 :

Exercice 5 :
Exercice 6 :
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT biblio (livre | article)*>
<!ELEMENT livre (titre, auteur+, tome*, edition, avis?)>
<!ELEMENT titre (#PCDATA)>
<!ELEMENT auteur (#PCDATA)>
<!ELEMENT tome (nb_pages)>
<!ELEMENT nb_pages (#PCDATA)>
<!ELEMENT edition (editeur, lieu_edition, lieu_impression, isbn)>
<!ELEMENT editeur (#PCDATA)>
<!ELEMENT lieu_edition (#PCDATA)>
<!ELEMENT lieu_impression (#PCDATA)>
<!ELEMENT isbn (#PCDATA)>
<!ELEMENT avis (#PCDATA)>
<!ELEMENT article (titre, auteur+, journal)>
<!ELEMENT journal (nom_journal, page, num_journal, annee)>
<!ELEMENT nom_journal (#PCDATA)>
<!ELEMENT page (#PCDATA)>
<!ELEMENT num_journal (#PCDATA)>
<!ELEMENT annee (#PCDATA)>
Exercice 7 :
Exercice 8 :
<?xml version="1.0"?>
<!DOCTYPE carnet SYSTEM "carnet.dtd">
<carnet>
<personne nom="dupont" prenom="jean" telephone="001122"/>
<personne nom="dupond" telephone="221100"/>
</carnet>

Vous aimerez peut-être aussi