, where nodeName is replaced
//with the name of your xml tag
if(mainTag.nodeName.toLowerCase() == "moreovernews") {
//if we have a match, we collect all of the articles beneath it as an array of xml objects
articleList = mainTag.childNodes;
//now we loop over all the articles and look for the tags we are looking for...
content_feed_display = "";
for(i=0;i<=articleList.length;i++){
//initialize a couple of variables to hold xml data we want displayed
document_url = "";
headline_text = "";
source_text = "";
if(articleList[i].nodeName.toLowerCase() == "article") {
//we get the child node array beneath the articles, aka the meat and potatoes we are after
elementList = articleList[i].childNodes;
//and loop through that looking for the data we need
for(j=0;j<=elementList.length;j++) {
elementTag = elementList[j];
elementType = elementTag.nodeName.toLowerCase();
if(elementType == "headline_text"){
headline_text = elementTag.firstChild.nodeValue;
} else {
if(elementType == "url"){
url = elementTag.firstChild.nodeValue;
} else {
if(elementType == "source"){
source_text = elementTag.firstChild.nodeValue;
}
}
}
}
content_feed_display += ""+ headline_text +"
Fuente: " + source_text + "
";
}
}
}
}