salut je suis nouveau utilisateur d' ajax alors je me suis stopper sur comment afficher données dynamique qui venont de mon base vers fichier xml

voici mon fichier xml (ceci est un test )
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="ISO-8859-1"?><root>
<client><ID>1</ID><nom>rochdi</nom><prenom>mehdi</prenom><email>soopranoo@hotmail.fr</email><fonction>internet</fonction></client>
 
<client><ID>2</ID><nom>rochdi</nom><prenom>maria</prenom><email>saria13@hotmail.com</email><fonction>internet</la maison></client>
 
<client><ID>3</ID><nom>rochdi</nom><prenom>fettah</prenom> <email>no email</email><fonction>la marine</fonction></client>
 
</root>
tableau.php

le code original
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<HTML>
<HEAD>
<TITLE>JavaScript Source Code 3000:  Forms:  Dynamic Table</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 3000" CONTENT = "no-cache">
<META NAME="description" CONTENT="(Internet Explorer 5+ and Netscape 6+ Only)  Enter information into this dynamic table and see the power of W3C-DOM compatible browsers.  Absolutely Amazing!">
<META NAME="date" CONTENT="2000-11-03">
<META NAME="channel" CONTENT="Web Developer">
<META NAME="author" CONTENT="Bob Simpson">
<META NAME="section" CONTENT="Forms">
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Bob Simpson (webmaster@maryjanebrown.net) -->
<!-- Web Site:  http://maryjanebrown.net/webmaster -->
 
 
 
 
<!-- Begin
function VER5_Check() {
var b = navigator.appName;
if (b == "Netscape") this.b = "NS";
else if (b == "Microsoft Internet Explorer") this.b = "IE";
this.v = parseInt(navigator.appVersion);
this.IE5 = (navigator.userAgent.indexOf('MSIE 5') > 0);
this.NS5 = (this.b == "NS" && this.v == 5);
this.VER5 = (this.IE5 || this.NS5);
}
is = new VER5_Check();
if(! is.VER5) {
alert("Internet Explorer 5.0 or Netscape NS6 needed to view this site.");
document.write('<meta http-equiv="refresh" content="0; url=index.shtml">');
}
//  End -->
</script>
</HEAD>
 
 
<!-- Demonstration -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Bob Simpson (webmaster@maryjanebrown.net) -->
<!-- Web Site:  http://maryjanebrown.net/webmaster -->
 
 
 
 
<!-- Begin
document.write('<center>');
document.write('<form name="form0">');
document.write('<input type="text" name="row" size=6 value="">');
document.write('<input type="text" name="name" size=24 value="">');
document.write('<input type="text" name="address" size=24 value="">');
document.write('<input type="text" name="city" size=24 value="">');
document.write('</form>');
document.write('</center>');
var _id;
var _ff = 0;
var _rawId = null;
var _pages = 0;
var _chgFlag = null;
_cellZero = null;
var _tableStyle="border:0;align:center;width:600";
var _headerData = new Array("No.","Name","Address","City");
var _tableData = new Array("1","Jones, Tom","110 James Street","Tacoma,WA",
"2","Cummings","123 Cray St.","Vashon, WA",
"3","Simpson","Javascript St.","Vashon, WA",
"4","Gates","Microsoft Way","Redmond, WA",
"5","Paul Allen","Defunct Kingdome","Seattle, WA",
"6","Jane Allen","King Street","Seattle, WA",
"7","Henry Bacon","Elliot Ave.","Seattle, WA",
"8","John Doe","Ballard","Seattle, WA",
"9","Mr. Floppy","Smith Tower","Seattle, WA",
"10","Jerry Allen","Everett Ave.","Seattle, WA",
"11","June Allen","King Street","Bellevue, WA",
"12","George Bacon","Elliot Ave.","Seattle, WA",
"13","Diane Doe","Ballard","Seattle, WA",
"14","Mrs. Floppy","Smith Tower","Seattle, WA",
"15","Jeff Allen","Everett Ave.","Seattle, WA",
"16","Mrs. Avery","Smith Tower","Seattle, WA",
"17","Henry Aldrich","Everett Ave.","Seattle, WA",
"18","Tom Turkey","Smith Tower","Seattle, WA",
"19","Rochdi mehdi","Everett Ave.","Seattle, WA");
// -->
</script>
<script type="text/javascript" language="Javascript1.2">
<!-- // Begin
function build_W3C_body() {
docBody = document.getElementsByTagName("body").item(0);
mySite = document.createElement("DIV");
mySite.id = "_mysite";
mySite.style.fontWeight="bold";
mySite.setAttribute("align","center");
buildDataTable(docBody, _tableData, _tableStyle, _headerData);
buttonDiv = document.createElement("DIV");
buttonDiv.setAttribute("align","center");
msgDiv = document.createElement("DIV");
msgDiv.id="message";
msgDiv.style.width=600;
msgDiv.style.height=25;
msgDiv.style.backgroundColor = "maroon";
msgDiv.style.color = "white";
msgDiv.style.fontWeight = "bold";
msgDiv.appendChild(document.createTextNode("Click cell in upper table to get row values!"));
buttonDiv.appendChild(msgDiv);
style = "width:205px;height:24px;fontSize:8pt;fontWeight:bold;backgroundColor:d5d5d5;";
makeButton("update",buttonDiv,style,"UPDATE TABLE");
style = "visibility:visible;width:204px;height:24px;fontSize:8pt;fontWeight:bold;backgroundColor:d5d5d5";
makeButton("tran",buttonDiv,style,"TRANSMIT CHANGES");
style = "width:96;height:24px;fontSize:8pt;fontWeight:bold;backgroundColor:d5d5d5";
makeButton("up",buttonDiv,style,"SCROLL-UP");
style = "width:96px;height:24px;fontSize:8pt;fontWeight:bold;backgroundColor:d5d5d5";
makeButton("down",buttonDiv,style,"SCROLL-DN");
docBody.appendChild(buttonDiv);
}
var _butMsg = new Array
_butMsg[0] = "Click cell in upper table to get row values !";
_butMsg[1] = "Add Custom Messages!";
_butMsg[2] = "Edit in input boxes above.";
_butMsg[3] = "Add Custom Messages!";
_butMsg[4] = "Click update table to update & create tran table.";
_butMsg[5] = "Add Custom Messages!";
_butMsg[6] = "Click update table to update & create tran table.";
_butMsg[7] = "Add Custom Messages!";
_butMsg[8] = "Scroll buttons scroll up or down 5 rows.";
_butMsg[9] = "Add Custom Messages!";
_butMsg[10] = "Transmit button not implemented at present.";
_butMsg[11] = "One row in tran table represents all changes to that row.";
var _z=0;
var _twoCnt = 0;
var _butFlg = 0;
function buttonMsg() {
if(_butFlg == 0) {
document.getElementById("message").style.visibility = "visible";
document.getElementById("message").style.backgroundColor = "maroon";
document.getElementById("message").style.color = "white";
if(_twoCnt == 0) {
document.getElementById("message").firstChild.nodeValue = _butMsg[_z++];
}
_twoCnt++
if(_twoCnt == 3)
_twoCnt = 0;
if(_z == _butMsg.length)
_z = 0;
   }
}
document.onmousedown = buttonDown;
document.onmouseover = mouseOver;
document.onmouseout = mouseOut;
function mouseOver(e) {
tmp = (is.NS5) ? e.target.getAttribute("id") : event.srcElement.id;
if(tmp.substring(0,1) == "_" || ! tmp) return;
_butFlg = 1;
upButton = document.getElementById("message")
if(tmp == "tran")
buttonColor(tmp,"cdfff6","blue",upButton,"Transmit lower table to server - for test purposes only at present.");
if(tmp == "update")
buttonColor(tmp,"cdfff6","blue",upButton,"Update upper & lower tables.");
if(tmp == "up")
buttonColor(tmp,"cdfff6","blue",upButton,"Scroll table up 5 rows.");
if(tmp == "down")
buttonColor(tmp,"cdfff6","blue",upButton,"Scroll table down 5 rows.");
if(tmp == "javaX")
buttonColor(tmp,"blue","white",upButton,"Go to good Javascript source.");
if(tmp == "siteX")
buttonColor(tmp,"blue","white",upButton,"Go to Bob Simpson's Javascript site");
if(tmp == "mailX")
buttonColor(tmp,"blue","white",upButton,"E-mail author if any questions");
if(tmp == "sourceX")
buttonColor(tmp,"blue","white",upButton,"Source for this page (dom_table.zip)");
if(tmp == "tranTable") {
upButton.style.backgroundColor = "red";
upButton.style.color = "white";
upButton.firstChild.nodeValue = "Changes not allowed here - make changes in upper table !"
}
if(parseInt(tmp) >= 0) {
if(parseInt(tmp.substring(tmp.length-1,tmp.length)) == 0) {
buttonColor(tmp,"red","white",upButton,"Changes to row number not allowed !");
table.style.backgroundColor="red";
}
else {
buttonColor(tmp,"black","white",upButton,"Click cell to get row values - edit in upper input boxes.");
table.style.backgroundColor = "black";
   }        
}
if(tmp.substring(tmp.length-1,tmp.length) == "X") {
document.getElementById(tmp).style.color = "red";
table.style.backgroundColor = "blue";
   }
}
function mouseOut(e) {
table.style.backgroundColor="maroon";
tmp = (is.NS5) ? e.target.getAttribute("id") : event.srcElement.id;
if(tmp.substring(0,1) == "_" || ! tmp) return;
_butFlg = 0;
document.getElementById("message").style.color = "white";
document.getElementById("message").style.backgroundColor = "maroon";
document.getElementById("message").firstChild.nodeValue = "Click upper table cell to get row values";
if(parseInt(tmp) >= 0 && parseInt(tmp) < 44)
document.getElementById(tmp).style.backgroundColor = "eeeeee";
else if(tmp.substring(tmp.length-1,tmp.length) != "X" && tmp != "message" && tmp != "tranTable") {
document.getElementById(tmp).style.backgroundColor="d5d5d5";
}
if(tmp.substring(tmp.length-1,tmp.length) != "X") document.getElementById(tmp).style.color = "black";
else document.getElementById(tmp).style.color = "blue";
}
function buttonDown(e) {
if( ((is.NS5) ? e.which : event.button) != 1) return true;
tmp = (is.NS5) ? e.target.getAttribute("id") : event.srcElement.id;
if(! tmp)
return true
if(tmp.substring(tmp.length-1,tmp.length) == 0)
return;
if(tmp == "down")
scrollDown();
if(tmp == "up")
scrollUp();
if(parseInt(tmp) || tmp == "00")
getRowValue(tmp);
if(tmp == "update")
changeRow();
if(tmp == "tran")
buildTranStr();
}
function buttonColor(id,backColor,fontColor,id1,message) {
if(id.substring(id.length-1,id.length) != "X") {
document.getElementById(id).style.backgroundColor = backColor;
document.getElementById(id).style.color = fontColor;
}
id1.firstChild.nodeValue = message;
id1.style.color = fontColor;
id1.style.backgroundColor = backColor;
} 
function scrollDown() {
id = _pages * 20;
p = id + 20;
ct = ((_tableData.length-p)/4);
if(ct < 0) return;
for(i = 0; i < 5; i++) {
for(j = 0; j < 4; j++) {
myCell = document.getElementById(i+''+j);
if(ct > 0)
myCell.firstChild.nodeValue = _tableData[p++];
else document.getElementById(i+''+j).firstChild.nodeValue = " - ";
}
ct--;
}
_pages++;
} 
function scrollUp() {
if(_pages==0) return;
id = _pages * 20 ; p = id - 20 ; x = p + 20;
for(i = 0; i < 5; i++) {
for(j = 0; j < 4; j++) {
document.getElementById(i+''+j).firstChild.nodeValue = _tableData[p++];
   }
}
_pages--;
}
function buildDataTable(appendToId, data, style, header) {
table = document.createElement("TABLE");
table.style.backgroundColor = "maroon";
t = style.split(";");
for(i = 0; i < t.length;) {
f = t[i++].split(":");
x = "table."+f[0]+"='"+f[1]+"'";
eval(x);
}
tablebody = document.createElement("TBODY");
row = document.createElement("TR");
for(var i = 0; i < header.length; i++) {
cell = document.createElement("TD");
if(i == 0)
cell.setAttribute("width","60px");
else cell.setAttribute("width","170px");
cell.setAttribute("align","center");
cell.style.backgroundColor = "lightgreen";
cell.style.fontWeight = "bold";
cell.appendChild(document.createTextNode(header[i]));
row.appendChild(cell);
}
tablebody.appendChild(row);
c = 0;
ptr = (data.length > 20) ? 20 : data.length;
for(var i = 0; i < ptr;) {
row = document.createElement("TR");
for(j = 0; j < header.length; j++) {
if(j == 1) {
cell.setAttribute("align","center");
cell.style.fontWeight = "bold";
}
cell = document.createElement("TD");
cell.setAttribute("id",c+''+j);
cell.style.backgroundColor = "#eeeeee";
cell.appendChild(document.createTextNode(data[i++]));
row.appendChild(cell);
}
c++;
tablebody.appendChild(row);
}
table.appendChild(tablebody);
appendToId.appendChild(table);
}
function buildTranTable() {
if(_ff == 1) {
tBody = document.getElementById("tBod");
myTR = document.getElementsByTagName("TR");
for(i = 6;i < myTR.length; i++) {
if(document.form0.row.value == myTR.item(i).firstChild.firstChild.nodeValue) tBody.removeChild(myTR.item(i));
   }
}
if(_ff == 0) {
table1 = document.createElement("TABLE");
table1.style.backgroundColor="maroon";
table1.id = "_table1";
table1.align = "center";
table1.border = 0;
table1.width = 600;
tablebody1 = document.createElement("TBODY");
tablebody1.id = "tBod";
}
row1 = document.createElement("TR");
row1.id = p;
for(i = 0; i < document.form0.length; i++) {
cell1 = document.createElement("TD");
cell1.id = "tranTable";
cell1.style.backgroundColor = "#eeeeee";
cell1.style.color = "black";
if(i == 0) {
cell1.setAttribute("width","60px");
cell1.setAttribute("align","center");
}
else cell1.setAttribute("width","170px");
a = document.form0.elements[i].value;
document.form0.elements[i].value = "";
if(i == 0)
cell1.appendChild(document.createTextNode(_cellZero));
else cell1.appendChild(document.createTextNode(a));
row1.appendChild(cell1);
}
tablebody1.appendChild(row1);
table1.appendChild(tablebody1);
docBody.appendChild(table1);
_ff = 1;
_chgFlag = null;
}
function buildTranStr() {
tranStr = "updateTable.cgi?";
myTDs = document.getElementsByTagName("TD");
if(myTDs.length<25)
return;
for(i=24;i<myTDs.length;) {
for(j=0;j<4;){
tranStr += j++ +"&" + myTDs.item(i++).firstChild.nodeValue + "=";
   }
}
alert("Not implemented in demo ! window.location = " +tranStr);
}
function changeRow() {
if(! _id) return;
p = ((_pages * 20) + (_id * 4));
_cellZero = document.getElementById(_id+0).firstChild.nodeValue;
for(i = 0; i < document.form0.length; i++) {
if(document.getElementById(_id+i).firstChild.nodeValue != document.form0.elements[i].value && i > 0) {
_chgFlag=true;
document.getElementById(_id+i).firstChild.nodeValue = document.form0.elements[i].value;
_tableData[p+i] = document.form0.elements[i].value;
   }
}
_id = 0;
if(_chgFlag) buildTranTable();
}
function getRowValue(x) {
_rawId = x;
_id = x.substring(0,x.length-1);
for(i = 0; i < document.form0.length; i++) {
document.form0.elements[i].value = document.getElementById(_id+i).firstChild.nodeValue;
}
selectedCell = x.substring(x.substring.length-1,x.substring.length);
setTimeout("cellSelect(selectedCell)",100);
}
function cellSelect(selectedCell) {
document.forms[0].elements[selectedCell].select();
}
function makeButton(myId,appendId,styleStr,text) {
myButton = document.createElement("BUTTON");
myButton.id =myId;
temStr = (styleStr.substring(styleStr.length-1,styleStr.length)==";") ?
	styleStr.substring(0,styleStr.length-1) : styleStr;
temp = temStr.split(";");
for(i = 0; i < temp.length; i++) {
x = temp[i].split(":");
str = "myButton.style."+x[0]+"='"+x[1]+"'";
eval(str);
}
myButton.appendChild(document.createTextNode(text));
appendId.appendChild(myButton);
}
function makeLink(href,text,styleStr,appendTo,linkId) {
link = document.createElement("A");
link.id=linkId;
temStr = (styleStr.substring(styleStr.length-1,styleStr.length)==";") ?
	styleStr.substring(0,styleStr.length-1) : styleStr
temp = temStr.split(";");
for(i = 0; i < temp.length; i++) {
x=temp[i].split(":");
str = "link.style."+x[0]+"='"+x[1]+"'";
eval(str);
}
link.setAttribute("href",href);
link.appendChild(document.createTextNode(text));
appendTo.appendChild(link);
}
window.onload = build_W3C_body;
//  End -->
</script>
<P>
<P>
 
</table>
</form>
la partie qui m'interesse c'est
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Bob Simpson (webmaster@maryjanebrown.net) -->
<!-- Web Site:  http://maryjanebrown.net/webmaster -->
 
 
 
 
<!-- Begin
document.write('<center>');
document.write('<form name="form0">');
document.write('<input type="text" name="row" size=6 value="">');
document.write('<input type="text" name="name" size=24 value="">');
document.write('<input type="text" name="address" size=24 value="">');
document.write('<input type="text" name="city" size=24 value="">');
document.write('</form>');
document.write('</center>');
var _id;
var _ff = 0;
var _rawId = null;
var _pages = 0;
var _chgFlag = null;
_cellZero = null;
var _tableStyle="border:0;align:center;width:600";
var _headerData = new Array("No.","Name","Address","City");
var _tableData = new Array("1","Jones, Tom","110 James Street","Tacoma,WA",
"2","Cummings","123 Cray St.","Vashon, WA",
"3","Simpson","Javascript St.","Vashon, WA",
"4","Gates","Microsoft Way","Redmond, WA",
"5","Paul Allen","Defunct Kingdome","Seattle, WA",
"6","Jane Allen","King Street","Seattle, WA",
"7","Henry Bacon","Elliot Ave.","Seattle, WA",
"8","John Doe","Ballard","Seattle, WA",
"9","Mr. Floppy","Smith Tower","Seattle, WA",
"10","Jerry Allen","Everett Ave.","Seattle, WA",
"11","June Allen","King Street","Bellevue, WA",
"12","George Bacon","Elliot Ave.","Seattle, WA",
"13","Diane Doe","Ballard","Seattle, WA",
"14","Mrs. Floppy","Smith Tower","Seattle, WA",
"15","Jeff Allen","Everett Ave.","Seattle, WA",
"16","Mrs. Avery","Smith Tower","Seattle, WA",
"17","Henry Aldrich","Everett Ave.","Seattle, WA",
"18","Tom Turkey","Smith Tower","Seattle, WA",
"19","Rochdi mehdi","Everett Ave.","Seattle, WA");
// -->
</script>
alors j'ai introduis ajax pour changer
var _tableData = new Array("1","Jones, Tom","110 James")
par des donnée dynamique du fichier xml

voila mon code que j'ai modifier

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Bob Simpson (webmaster@maryjanebrown.net) -->
<!-- Web Site:  http://maryjanebrown.net/webmaster -->
 
 
 
 
<!-- Begin
document.write('<center>');
document.write('<form name="form0">');
document.write('<input type="text" name="row" size=6 value="">');
document.write('<input type="text" name="name" size=24 value="">');
document.write('<input type="text" name="address" size=24 value="">');
document.write('<input type="text" name="city" size=24 value="">');
document.write('</form>');
document.write('</center>');
var _id;
var _ff = 0;
var _rawId = null;
var _pages = 0;
var _chgFlag = null;
_cellZero = null;
/********* ajax1*******************/
function ajax()
{
    var xhr=null;
 
    if (window.XMLHttpRequest) { 
        xhr = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) 
    {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
 
 	xhr.open("GET", "Xml/depot_cv.xml", true);
    xhr.send(null);
 
    xhr.onreadystatechange = function() { 
	if(xhr.readyState==4){
	alert_ajax(xhr); 
	}
 
	};
 
}
 
 
 
 
function alert_ajax(xhr)
{
	var docXML= xhr.responseXML;
	var items = docXML.getElementsByTagName("ID");
	var items1 = docXML.getElementsByTagName("nom");
	var items2 = docXML.getElementsByTagName("prenom");
	var items3 = docXML.getElementsByTagName("fonction");
 
	alert(items.length);
 
	var _tableStyle="border:0;align:center;width:800";
var _headerData = new Array("ID","Nom","Prenom","Email","Fonction");
for (i=0;i<items.length;i++)
	{
	var _tableData = new Array("items.item(i).firstChild.data","items1.item(i).firstChild.data","items2.item(i).firstChild.data","items3.item(i).firstChild.data");
	}
 
 
}
/**********************************/
// -->
</script>
maleuresement sa marche pas et j'en sais pas es ce que les modifs que j'ai effectué est logique ou non
svp aidez moi sur ca