This content has been marked as final. Show 3 replies
Try the attached code. It's not recursive, but this doesn't have to be bad.
I think this isn't the best possible structure (for the xml), but I guess you have your reasons.
The function takes in a XMLNode, and returns one. Use it like this:
employeesNode = this.firstChild.childNodes;
resultNode = parseNode( employeeNode, 1 ) // gets employeeNode.childNodes.childNodes[subNumber]
resultNode = parseNode( employeeNode, 2 ) // gets employeeNode.childNodes.childNodes[subNumber].childNodes.childNodes[subNumber ]
Thanks for the quick reaponse!
But it doesn't work... I get undefined on res...
Even if I define:
var employeesNode:XMLNode = local_xml.firstChild.childNodes;
the first time I load the xml file, and then try:
I get undefined.
I think it's because employeesNode is the actual xml data, and not the path (if I trace it alone I get a part of the xml itself), so you cannot append a path to it. is there any way I can get the path of employeesNode?
Thanks for your help!!!
no, wait... as always in these things, a stupid mistake. I now defined employeesNode as an xmlNode directly on the root. It seems to work! I have another error now but in general it seems ok.
You are a genius and a true saint. thank you!!!