hmmm, ho parlato troppo presto.

ho risolto solo parzialmente,
perché la funzione funziona esattamente solo fino al
trace("titolo"+k);
il
trace("introduzione"+k);
me lo da solo come 0 ed 1 ciò vuol dire che qualcosa non va nella funzione,
qualcuno sa aiutarmi?
proprio non capisco dove sbaglio...
grazie in anticipo.
riposto la funzione e il file xml modificati:
Codice PHP:
file_news_xml = "news_content.xml";
function apri_news() {
news_xml = new XML();
news_xml.load(file_news_xml);
news_xml.ignoreWhite = true;
news_xml.onLoad = ElaboraXML;
function ElaboraXML(success) {
if (news_xml.loaded) {
news_array = news_xml.childNodes;
dati_xml();
news();
delete news_array;
delete news_array2;
delete news_array3;
delete news_array4;
delete news_array5;
delete news_xml;
}
}
}
function dati_xml() {
_global.news_array = new Array ();
_global.news_array2 = new Array ();
_global.news_array3 = new Array ();
_global.news_array4 = new Array ();
_global.news_array5 = new Array ();
_global.news_data = new Array ();
_global.news_titolo = new Array ();
_global.news_intro = new Array ();
_global.news_txt = new Array ();
for (var j=0;j<=news_array.length;j++){
trace("news"+j);
if (news_array[j].nodeName == "news"){
news_array2 = news_array[j].childNodes;
for (var i=0;i<=news_array2.length;i++){
trace("notizia"+i); // controllo se funziona il ciclo for
if (news_array2[i].nodeName == "notizia"){
_global.news_data.push(news_array2[i].attributes.dt);
news_array3 = news_array2[i].childNodes;
for (var k=0;k<=news_array3.length;k++){
trace("titolo"+k); // controllo se funziona il ciclo for
if (news_array3[k].nodeName == "titolo"){
_global.news_titolo.push(news_array3[k].childNodes.toString());
news_array4 = news_array3[k].childNodes;
for (var w=0;w<=news_array4.length;w++){
trace("introduzione"+w); // controllo se funziona il ciclo for ma questo ciclo mi restituisce come output solo "introduzione0" ed "introduzione1", ciò significa che non lo fa tutto, è come se si bloccasse, eppure ho ricreato da 0 il file xml, rifatto completamente la funzione, insomma, perché si blocca???
if (news_array4[w].nodeName == "introduzione"){
_global.news_intro.push(news_array4[w].childNodes.toString());
news_array5 = news_array4[w].childNodes;
for (var v=0;v<=news_array5.length;v++){
if (news_array5[v].nodeName == "testo"){
_global.news_txt.push(news_array5[v].childNodes.toString());
}
}
}
}
}
}
}
}
}
}
}
questo invece è il file xml
Codice PHP:
<?xml version="1.0" encoding="UTF-8"?>
<news>
<notizia dt="06/07/2009">
<titolo>[b]titolo[/b]</titolo>
<introduzione>intro</introduzione>
<testo>testo</testo>
</notizia>
<notizia dt="06/07/2009">
<titolo>[b]titolo[/b]</titolo>
<introduzione>intro</introduzione>
<testo>testo</testo>
</notizia>
<notizia dt="06/07/2009">
<titolo>[b]titolo[/b]</titolo>
<introduzione>intro</introduzione>
<testo>testo</testo>
</notizia>
<notizia dt="06/07/2009">
<titolo>[b]titolo[/b]</titolo>
<introduzione>intro</introduzione>
<testo>testo</testo>
</notizia>
<notizia dt="06/07/2009">
<titolo>[b]titolo[/b]</titolo>
<introduzione>intro</introduzione>
<testo>testo</testo>
</notizia>
</news>