This content has been marked as final. Show 6 replies
Just based on quick look :-
a) give item a type i.e xml
b) myXML.department is an xmllist
c) the contents of xmllist's are xml
for each (var item:XML in myXML.department)
trace (item.department.@name); // or item.@department
this might work I am just doing from my head
Thanks but I have tried that already. It would print only IT, Accounts and HR. Please note that IT has child nodes also named department and are named R&D, Systems and Testing Q&A. Thats what I am having trouble printing. Sorry for not being so clear in my original post.
Use ".." to get all descendants. or use descendants()
var xlDepartments:XMLList = myXML..department;
for each (var item:XML in xlDepartments)
i m facing the same problem, i think using SAX parser we can resolve this problem, but i could not able to find any SAX implementation in AS3, if any one know plz share with me
As far as I know, you are stuck with e4x. E4x expressions are very powerful. Worst case you can recurse the hierarchy, but that is very rarely required.
I suggest you start a new thread, describe your problem, include some sample xml, we will try to help.
hmm, no i m not stuck with e4x,
as i know, in e4x u should already know the name of the node to manipulate, but what if dont know name, and i want to move node to node