<%@ page import = "org.w3c.dom.*,org.apache.xerces.parsers.DOMParser" %> Address Book CONTENT OF THIS PART¦¦LIST FORM¦¦HOMEPAGE¦¦ WORKPAGE¦¦ TECFA

Address Book of Contacts

Here are some of the contacts I treasure much (not exactly of course).


<% // URL String URL = "http://tecfa.unige.ch/staf/staf-e/sun/staf2x/xml/try.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 = "Entry"; String[] TheItemNames = { "FirstName", "LastName", "Birthday", "PhoneNumber", "Email", "Address", }; // 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(); for (int k=0; k1)&&(k"); } out.println(""); } out.println("
"); out.println("


SUN April 2000"); } catch (Exception e) { out.println (e.getMessage()); out.println ("

We stop soon, please correct the mistakes.


"); return; } %> Source