我有一些数据的XML的..如何分别从每个父节点获取子节点?
<main>
<TabNavigator x="27" y="11" width="455" height="376" id="gh" backgroundColor="#A4B6E9">
<NavigatorContent width="100%" height="100%" label="Client" id="clientTab"></NavigatorContent>
<NavigatorContent width="100%" height="100%" label="Admin" id="adminTab"></NavigatorContent></TabNavigator>
<TitleWindow x="521" y="84" width="377" height="234">
<DataGrid x="0" y="0" width="375" height="163" borderVisible="true" id="details">
<columns>
<ArrayList>
<GridColumn dataField="Name" id="arrayName"/><GridColumn dataField="Address" headerText="Address"/>
<GridColumn dataField="Phone_Number" headerText="Phone_Number"/>
</ArrayList>
</columns>
</DataGrid>
<Button x="139" y="167" height="28" label="Export"/>
</TitleWindow>
</main>
我使用以下用于检索给定XML的孩子的名字代码..
private function urlLdr_complete(event:Event):void{
var xmlData:XML=new XML(URLLoader(event.currentTarget).data);
for each (var t:XML in xmlData.children())
{
Alert.show(t.Name);
}
但我只得到2名儿童(TabNavigator的和TitleWindow中)。如何我在每个父节点中获得其他孩子吗?我想为每个家长单独的孩子。我怎么才能得到它?
[我如何从Xml数据获取所有子节点?](http://stackoverflow.com/questions/12137607/how-i-get-all-the-children-nodes-from-xml-数据) – Kodiak
同意 - 这是重复的。或者,另一方面,考虑到时间安排,这是重复的。 – JcFx