views:

12

answers:

1

Hi,

i'm getting the xmldata from the httpservice (using cgi) and i have not set resultformat(it is coming as an object only),the xml data in this format <root> <employee name="xxx" age="xx" gender="xxx"/> <employee name="xxx" age="xx" gender="xxx"/> <employee name="xxx" age="xx" gender="xxx"/> </root> when i was tried to count the employee tag,i getting the problem, my code will like this:

var i:int=o; for each(var obj:object in event.result.root.employee) { i++; } i getting the count as 3 but the problem it give the count as 3 when the coming data i.e)the xml data is <root> <employee name="xxx" age="xx" gender="xxx"/> <root>

actually i want to count the number of employees tag not all subtag , i hope you may save my time Thanks in advance..