Académique Documents
Professionnel Documents
Culture Documents
En xmllink
Installation sous le système d’exploitation Windows :
https://www.zlatkovic.com/pub/libxml/
irst check what you need to download. There are several packages available and some of them
depend on the others. The packages available on this site are:
How these packages depend on each other is shown in the following figure:
Lors de ce TP et des suivants, nous serons amenés à utiliser xmllint qui est un petit
Utilitaire en ligne de commande pour valider et manipuler des fichiers xml.
<un>
essai
</deux>
Afin de vérifier si le document est bien formé en exécute la
commande en ligne suivant :
xmllint −−noout doc.xml
Le résultat après exécution est le suivant :
dmf.xml:3: error: Opening and ending tag mismatch: un and deux
</deux>
1
Exercice 1 Correction de documents XML
@InProceedings{DalzilioS:learnbs,
author = "Dal Zilio, Silvano
and Bernard, Thierry M.",
title = "Learning Binary Shapes as Compression and its
Cellular Implementation",
booktitle = "ACCV '95 -- 2nd Asian Conference on Computer
Vision",
year = 1995,
volume = 2,
pages = "616--620",
month = dec,
url = "http://www.cmi.univ-mrs.fr/~dalzilio/Papers/accv95.ps",
abstract = "We present a methodology to learn how to
recognize binary shapes, based on the principle that
recognition may be understood as a process of
information compression. Our approach, directed
towards adaptive target tracking applications, is
intended to be well suited to fine-grained parallel
architectures, such as cellular automata machines
that can be integrated in artificial retinas. This
methodology, fruitfully explained within the frame
of mathematical morphology, is then particularized
in the perspective of its actual implementation."
Cette entrée correspond à un article paru dans une conférence. Une traduction possible de ces
données sous la forme d'un fichier XML se trouve dans le fichier inproc.xml. Traduisez les
entrées bibliographiques de l'article et du livre se trouvant dans le fichier biblio.bib.
Exercice 3 :
On souhaite écrire un livre en utilisant le formalisme XML. Le livre est structuré en sections,
en chapitres (au moins 2 par section) et en paragraphes (au moins 2 par chapitre). Le livre doit
contenir la liste des auteurs (avec nom et prénom).
Le livre ainsi que chaque section et chaque chapitre doivent posséder un titre. Chaque
paragraphe doit contenir du texte.
Proposez un exemple de livre formaté comme un document XML respectant les contraintes
susmentionnées avec 3 sections. Vérifier la validité de votre document via la commande
xmllint.
2
Vérifiez la validité des 5 fichiers XML, donnés plus bas, relativement à la DTD pingpong.dtd
ci-dessous. Si un fichier est invalide, corrigez-le pour le rendre valide, en Minimisant le
nombre de corrections. Vérifiez que votre fichier est bien formé et valide en utilisant
la commande xmllint −−noout –dtdvalid nomfichier.dtd
nomfichier.xml.
<!ELEMENT racine (debut? , suite+)>
<!ELEMENT debut (ping? , pong*)>
<!ELEMENT suite (ping , pong)>
<!ELEMENT ping (#PCDATA)>
<!ELEMENT pong (#PCDATA)>
pp1.xml :
<racine>
<debut>
<ping/><pong/>
</debut>
<suite>
<ping/><pong/>
</suite>
<suite>
<ping/><pong/>
</suite>
</racine>
pp2.xml :
<racine>
<debut/>
<suite>
<ping/><pong/>
</suite>
</racine>
pp3.xml :
<racine>
<debut>
<ping/><ping/>
<pong/><pong/>
</debut>
<suite>
<ping/><pong/>
</suite>
</racine>
pp4.xml :
<racine>
<suite>
<pong/><pong/>
</suite>
<suite>
3
<ping/><pong/>
</suite>
</racine>
pp5.xml :
<racine>
<debut/>
<suite/>
</racine>