xml解析解决思路
xml解析XML codereportsheetrow idheadcell姓名/cellcell密码/cell/rowrow idbody
xml解析
XML code<report> <sheet> <row id="head"> <cell>姓名</cell> <cell>密码</cell> </row> <row id="body"> <cell>张三</cell> <cell>123</cell> </row> <row id="body"> <cell>李四</cell> <cell>345</cell> </row> </sheet></report>
ex4 类型, 如何解析得到 id= “head”的 姓名和密码值绑定到 datagrid
[解决办法]for (var i:int=0; i < compareXml.report.sheet.row.elements("cell").length(); i++){
//可以得到
<cell>姓名</cell>
<cell>密码</cell>
}
解析xml
[解决办法]楼主想要的可能是一个E4X的表达式,直接用在控件里
设你的XML变量是xData
则dataProvider="{xData.sheet.row.(@id='head')}"
[解决办法]