Welcome

首页 / 软件开发 / Flex / flex in action (三)flex对xml数据进行处理二

flex in action (三)flex对xml数据进行处理二2010-11-23 BlogJava duduli本讲的一个重点。ArrayCollection对一个字段的一个数据的取得: xmls.getItemAt(0).name.toString()。

这东西弄了我很久,大概是受 Java的影响吧。

首先编写xml。在src下建立xml文件夹,然后建立一个 student.xml的文件。

文件内容:

1 <?xml version="1.0" encoding="UTF-8"?>
2 <persons>
3 <person>
4 <name>金浩</name>
5 <sex>man</sex>
6 <age>23</age>
7 <clazz>数学一 班</clazz>
8 </person>
9
10 <person>
11 <name>张伟 </name>
12 <sex>man</sex>
13 <age>22</age>
14 <clazz>英语四班</clazz>
15 </person>
16 <person>
17 <name>蒋天傲</name>
18 <sex>man</sex>
19 <age>23</age>
20 <clazz>计算四 班</clazz>
21 </person>
22
23 <person>
24 <name>熊敏之 </name>
25 <sex>man</sex>
26 <age>23</age>
27 <clazz>计算机一班</clazz>
28 </person>
29 <person>
30 <name>熊超</name>
31 <sex>man</sex>
32 <age>23</age>
33 <clazz>计算二 班</clazz>
34 </person>
35
36 <person>
37 <name>张洋 </name>
38 <sex>woman</sex>
39 <age>22</age>
40 <clazz>英语四班</clazz>
41 </person>
42 <person>
43 <name>朱宇</name>
44 <sex>man</sex>
45 <age>23</age>
46 <clazz>英语一 班</clazz>
47 </person>
48
49 <person>
50 <name>夏政 </name>
51 <sex>man</sex>
52 <age>23</age>
53 <clazz>计算机四班</clazz>
54 </person>
55 </persons>