Question
Understanding XML in Flash
I have an XML statement that successfully loads the XML file:
theGameData.load ("game_content_dev.xml");
Then an XPATH statement that gets all the <question> nodes out of theGameData:
_global.questionsArrayAll = XPathAPI.selectNodeList(theGameData.firstChild, "/interactionData/module/question[@learningRouletteUsage='yes']");
I then can trace out the first child node of the first <question> node by using:
trace (questionsArrayAll[0].firstChild);
or the last child node using .lastChild
... but I can't figure out how to get anyt of the nodes in between. I would have though .childNode[1], childNode[2], etc.. would work but they always return "undefined". I can't figure out an XPATH way of doing this either...
Any help? The XPathAPI class document is about useless, the only example it lists is using firstChild syntax.
Thanks! - Mike
theGameData.load ("game_content_dev.xml");
Then an XPATH statement that gets all the <question> nodes out of theGameData:
_global.questionsArrayAll = XPathAPI.selectNodeList(theGameData.firstChild, "/interactionData/module/question[@learningRouletteUsage='yes']");
I then can trace out the first child node of the first <question> node by using:
trace (questionsArrayAll[0].firstChild);
or the last child node using .lastChild
... but I can't figure out how to get anyt of the nodes in between. I would have though .childNode[1], childNode[2], etc.. would work but they always return "undefined". I can't figure out an XPATH way of doing this either...
Any help? The XPathAPI class document is about useless, the only example it lists is using firstChild syntax.
Thanks! - Mike
