2010-08-18 58 views
0

我是從的HTTPService(使用CGI)獲得XMLDATA,我還沒有設置的resultFormat(它是未來,因爲只有一個對象),這種格式的XML數據如何計算xmldata?

<root> 
<employee name="xxx" age="xx" gender="xxx"/> 
<employee name="xxx" age="xx" gender="xxx"/> 
<employee name="xxx" age="xx" gender="xxx"/> 
</root> 

當我試圖計算員工標籤,我得到這個問題,我的代碼將是這樣的:

var i:int=o; 
for each(var obj:object in event.result.root.employee) 
{ 
i++; 
} 

我得到的計數爲3,但問題是給計數爲3時,即將到來的數據IE)的XML數據

<root> 
<employee name="xxx" age="xx" gender="xxx"/> 
<root> 

其實我想指望員工標籤)

數量不是所有的子標籤, 我希望你可以節省我的時間 在此先感謝..

回答