I found my problem so ridiculous. although the while was incorrect, the for didn't work neither. the problem was that I have used different variables with the same name item
. the problem was solved when I changed the code like so:
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4)
if( this.status == 200) {
response = xmlhttp.responseXML;
var channel = response.documentElement;
var title = channel.getElementsByTagName("title")[0].firstChild.nodeValue;
var parent = document.getElementById("journalTitle");
parent.innerHTML = title;
var articleList = document.getElementById("articleList");
item = channel.getElementsByTagName("item");
var list = new Array();
itemSize = (channel.getElementsByTagName("item").length);
for (i = 0;i<itemSize;i++){
list[i] = item[i].getElementsByTagName("title")[0].firstChild.nodeValue;
itemD = document.createElement("div");
itemD.innerHTML = list[i];
articleList.appendChild(itemD);
}
}
}