PDA

View Full Version : Can I access XML nodeName?



theSchtickler
February 22nd, 2009, 11:30 PM
Hi there,

I load all my content via XML these days into my flash site, but I was wondering if there is a way to access the nodeName of the XML I am bringing in? Now I don't know if this is a very stupid way to do things, but I usually parse all the data into an array as I bring it thru the onLoad command.

So instead doing this:

book[i] = this.firstChild.childNode[3].firstChild.nodeValue;

... can I do something like :

book[i] = this.firstChild.nodeName['booktitle'].firstChild.nodeValue;

Can anyone suggest a better way?