ici

Transcription

ici
MASTER 2 IST
2007-08
XML et Java :: TD#3
Soit le document 1, que vous pouvez obtenir sur à l'URL :
http://www.univ-mlv.fr/~ocure/exoXML3.xml.
Ecrire les programmes Java qui vont permettre d'obtenir en sortie le
document 2 (les informations sur les cd du type 'jazz).
Exercice 1
En exploitant l'API SAX.
Exercice 2
En exploitant l'API DOM.
<?xml version="1.0"?>
<records>
<cd type="jazz">
<title>None too soon</title>
<artist>Allan Holdsworth</artist>
<country>UK</country>
<company>Polidor</company>
<year>1996</year>
</cd>
<cd type="jazz">
<title>All night wrong</title>
<artist>Allan Holdsworth</artist>
<country>UK</country>
<company>Sony</company>
<year>2002</year>
</cd>
<cd type="rock">
<title>1984</title>
<artist>Van Halen</artist>
<country>US</country>
<company>Warner­Bros</company>
<year>1984</year>
</cd>
<cd type="rock">
<title>Elminiator</title>
<artist>ZZTop</artist>
<country>US</country>
<company>Warner­Bros</company>
<year>1984</year>
</cd>
<cd type="jazz">
<title>Imaginary day</title>
<artist>Pat Metheny Group</artist>
<country>US</country>
<company>Warner­Bros</company>
<year>1997</year>
</cd>
</records> Document 1
<html>
<body>
<h1>Titre du cd : None too soon</h1>
Auteur : Allan Holdsworth<br/>
Edite chez Polidor en :1996<br/>
<h1>Titre du cd : All night wrong</h1>
Auteur : Allan Holdsworth<br/>
Edite chez Sony en :2002<br/>
<h1>Titre du cd : Imaginary day</h1>
Auteur : Pat Metheny Group<br/>
Edite chez Warner­Bros en :1997<br/>
</body>
</html>
Document 2

Documents pareils