- Ext.onReady(function(){
- //alert();
- var store = new Ext.data.Store({
- url: 'hello.xml',
- reader: new Ext.data.XmlReader({
- record: 'country'
- }, [{
- name: 'country',
- mapping: 'cid'
- }])
- });
- store.load()
- alert(store.getCount());
- });
xml 文件
<?xml version="1.0" encoding="utf-8"?>
<conf>
<country name="China">
<cid>China</cid>
<province name="ShanXi">
<pid>ShanXi</pid>
<city>TaiYuan</city>
<city>DaTong</city>
<city>YunCheng</city>
</province>
</country>
<country name="America">
<cid>America</cid>
<province name="Florida">
<pid>aaa</pid>
<city>bbb</city>
<city>ccc</city>
<city>ddd</city>
</province>
</country>
</conf>