XML TO ArrayCollection 两种实现方式
<?xml version="1.0" encoding="UTF-8"?>
<projects>
<node Country="暗暗啊" Gold="10" Silver="20" Bronze="30"/>
<node Country="白斑病" Gold="30" Silver="20" Bronze="10"/>
<node Country="常常厂" Gold="20" Silver="40" Bronze="60"/>
<node Country="赌东道" Gold="50" Silver="30" Bronze="10"/>
<node Country="饿饿额" Gold="15" Silver="18" Bronze="46"/>
<node Country="方法法" Gold="61" Silver="52" Bronze="38"/>
</projects>
<mx:HTTPService id="HTTPService1"
url="charts_ColumnChart.xml"
result="initFile(event)" showBusyCursor="true" method="post"
resultFormat="e4x"/>
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
private var ac:ArrayCollection = new ArrayCollection();
function initFile(event:ResultEvent):void{
for each(var p:XML in event.result..node){
var obj:Object=new Object();
obj.Country=p.@Country;
obj.Gold=p.@Gold;
obj.Silver=p.@Silver;
obj.Bronze=p.@Bronze;
ac.addItem(obj);
}
}
二:
复制代码 代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<projects>
<node>
<Country>暗暗a</Country>
<Gold>10</Gold>
<Silver>20</Silver>
<Bronze>30</Bronze>
</node>
<node>
<Country>暗b啊</Country>
<Gold>10</Gold>
<Silver>20</Silver>
<Bronze>30</Bronze>
</node>
<node>
<Country>暗c啊</Country>
<Gold>10</Gold>
<Silver>20</Silver>
<Bronze>30</Bronze>
</node>
</projects>
<mx:HTTPService id="HTTPService2"
url="charts_ColumnChart1.xml"
result="initFile1(event)" showBusyCursor="true" method="post"
resultFormat="e4x"/>
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
private var ac1:ArrayCollection = new ArrayCollection();
function initFile1(event:ResultEvent):void{
for each(var p:X
相关文档:
扩展标记语言XML(eXtensible Markup Language),是由W3C组织制定的。做为用于替代HTML语言的一种新型的标记语言,XML内部有着很多基本标准,XML就是通过与这些相关标准地结合,应用于科学计算、电子出版、多媒体制作和电子商务的。C#作为一种新型的程序语言,是.Net框架的一个重要组成部分,他和XML的关系颇深。本文就从 ......
VC解析XML--使用CMarkup类解析XML
(一) 先讲一下XML中的物殊字符,手动填写时注意一下。
字符 字符实体
& &nb ......
■ 开发前要求配置
■ Select XML格式数据
■ Insert XML格式数据
■ Updata XML格式数据
■ Delete XML格式数据
开发前要求配置
必须安装Oracle客户端
把Classpath指向
classes111.zip ......
先创建数据然后生成相应的xml文件
DataSet ds = new DataSet();
#region Parent Table
DataTable dt1 = new DataTable("Parent");
......
转:http://hi.baidu.com/oneshotonekill/blog/item/be68b513f7c929d7f6039e1e.html
Whitespace is not allowed before an XML Processing Instruction (< ? ... ?>). HTMLComponent.Eclipse在编辑mxml的时候提示这样的错误。检查才发现代码中在<? ?>之前存在空格。 ......