I already know a bit about parsing through XML, however this is a bit tricky for me. I’m working with a dynamic menu created from XML. I have it working nicely, and that everytime you click on something in the XML, it updates an array with the node index. It’s actually pretty nice.
So in other words, if my array was [0,4,1]; this means that I’m in node 1, node 5, node 2 deep into the XML. (this.firstChild.childNodes[0].childNodes[4].childNodes[1])
What I’m asking for help on though is the reverse. I would I quickly take an array of node indexes and find their values and attributes in an XML document?
From the above example I would need:
this.firstChild.childNodes[0].attributes._label;
this.firstChild.childNodes[0].childNodes[4].attributes._label;
this.firstChild.childNodes[0].childNodes[4].childNodes[1].attributes._label
but in some kind of nice function format that would return it to me in a string.