I know this subject has been covered extensively by Kirupa, it’s members and a whole world of other people… However :be:
I am having the silliest problem, and it just proves that I am very new at this indeed! What I am trying to do, is load a very simple xml file into 1 textbox.
The problem I am running into is that it only loads the first item.
Let’s say this is my xml file.
<news>
<new ntitle=“today” ndate=“date” nbody=“content”/>
<new ntitle=“tomorrow” ndate=“date” nbody=“content”/>
</news>
My code only loads the first one, but not the second node…
newsXml = new XML();
newsXml.ignoreWhite = true;
newsXml.onLoad = function(success) {
if (success) {
newsitems = this.firstChild.firstChild.attributes;
news_txt.htmlText = newsitems.ntitle + "<br>"+ newsitems.ndate + "<br>"+ newsitems.nbody + "<br><br>";
}
}
newsXml.load(“newsxml.xml”);
Obviously there is something wrong with what I’m doing, I have a feeling it may be something so simple… but for the life of me, I can’t see it…
Help