%@ page
import = "org.w3c.dom.*,org.apache.xerces.parsers.DOMParser"
%>
Quels vaccins pour quels pays ?
[RETOUR PAGE PRICNIPALE
VACCINS] - [HOMEPAGE]
- [PAGE TRAVAUX]
- [TECFA]
CONSEILS SUR LES VACCINS AVANT DE PARTIR EN VOYAGE
<%
// URL
String URL = "http://tecfa.unige.ch/staf/staf-e/vanessa/staf2x/ex4/vaccins.xml";
// DONNES// charge le document et cree le document xml ou exit si cela ne marche pas
try {
DOMParser parser = new DOMParser();
parser.parse(URL);
Document TheDocument = parser.getDocument();
// CONSTANTES
String ROOT_ELEMENT_TAG = "entree";
String[] TheItemNames = {
"Continents",
"Pays",
"Recommandes",
"Indispensables",
"Obligatoires",
"Preventions"
};
String id = request.getParameter("id");
// format a table
out.print( "
" );
out.print( "");
// display table column
for (int i=0; i"+TheItemNames[i]+"" );
};
out.print( "
" );
int TheFileNumber = TheDocument.getDocumentElement().getElementsByTagName(ROOT_ELEMENT_TAG).getLength();
// Print row by row
for (int i=0; i");
for (int j=0; j");
NodeList TheCurrentList = TheCurrentFile.getElementsByTagName(TheItemNames[j]);
int TheCurrentListItems = TheCurrentList.getLength();
String myElementName = "";
for (int k=0; k1)&&(k");
}
out.println("");
}
}
out.println("
");
out.println("
V.Scribante Mai 2000");
}
catch (DOMException e) {
out.println("DOM exception found");
out.println(e.getMessage());
}
catch (Exception e) {
out.println("");
out.println(e.getMessage());
out.println("
");
return;
}
%>