<? Xml version = "1.0" encoding = "UTF-8"?>
<List>
<Software>
<Name> Software 1 </name>
<Icon> 1.gif</icon>
</Software>
<Software>
<Name> Control 2 </name>
<Icon> 2.gif</icon>
</Software>
</List>
This is one of the most common examples on the Internet. I also want to write the main code.
Var Info = Ext. data. Record. create ([
'Name', 'icon''
]);
Reader = new Ext. data. XmlReader ({
Record: 'soft ',
Id: 'name'
}, Info );
Below is another format of xml
<? Xml version = "1.0" encoding = "UTF-8"?>
<Softwarelist>
<Software name = "software 1" icon = "1.gif"/>
<Software name = "Control 2" icon = "2.gif"/>
</Softwarelist>
Main Code read
Var Info = Ext. data. Record. create ([
{Name: 'name', mapping: '@ name '},
{Name: 'icon ', mapping:' @ icon '}
]);
Reader = new Ext. data. XmlReader ({
Record: 'soft ',
Id: 'name'
}, Info );
Only the first method is used in ext's help document. The second method is that I tried it for almost two hours. I still don't know why, but it can be used. Hope someone else can explain it. I have heard it!