Credo che tu voglia fare questo:
codice:
filexml = "mess.xml";
ApriXML(filexml);
function ApriXML(url)
{
mioXML = new XML();
mioXML.ignoreWhite = true;
apparray = new Array();
mioXML.load(url);
mioXML.onLoad = Metti;
}
function Metti(success)
{
if (success) {
apparray = mioXML.firstChild.childNodes;
Dati();
}
}
function Dati()
{
Nomi = new Array();
Dat = new Array();
Messaggi = new Array();
for (var k = 0; k < apparray.length; k++) {
var item = apparray[k].nodeName;
var valu = apparray[k].firstChild.nodeValue.toUpperCase();
if (item == "nome") {
Nomi.push(valu);
} else if (item == "msg") {
Messaggi.push(valu);
} else if (item == "data") {
Dat.push(valu);
}
}
Nomi.reverse();
Messaggi.reverse();
Dat.reverse();
}
ma con questo file xml...
codice:
<?xml version="1.0"?>
<primonodo>
<nome>a</nome>
<msg>b</msg>
<data>c</data>
</primonodo>