1、flex程序
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:XML id="xmlData" source="books.xml"/>
<mx:XMLListCollection id="books" source="{xmlData.book}"/>
<mx:Panel layout="absolute" left="0" right="0" top="0" bottom="0">
<mx:DataGrid x="347" y="136" width="406" height="195" dataProvider="{books}">
<mx:columns>
<mx:DataGridColumn headerText="bookname" dataField="bookname"/>
<mx:DataGridColumn headerText="author" dataField="author"/>
<mx:DataGridColumn headerText="price" dataField="price"/>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>
2、xml文件:
<?xml version="1.0" encoding="utf-8"?>
<books>
<!--this is a book about xml-->
<book>
<bookname>java && java</bookname>
<author>nobody&& nobody</author>
<price>28.5</price>
</book>
</books>
不知道为什么,我总是使用不明白javaeye的这个编辑器,谁知道留言给我教一下!