Мой файл XML является:Можно ли анализировать данные из xml, содержащего похожие теги?
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<investors>
<investor>Active</investor>
<investor>Aggressive</investor>
<investor>Conservative</investor>
<investor>Day Trader</investor>
<investor>Very Active</investor>
</investors>
<events>
<event>3 Month Expiry</event>
<event>LEAPS</event>
<event>Monthlies</event>
<event>Monthly Expiries</event>
<event>Weeklies</event>
<event>Weeklies Expiry</event>
</events>
<prices>
<price>0.05</price>
<price>0.5</price>
<price>1</price>
<price>1</price>
<price>22</price>
<price>100.34</price>
</prices>
</root>
мой ExtJS код:
Ext.regModel('Card', {
fields: ['investor','event','price']
});
var store = new Ext.data.Store({
model: 'Card',
proxy: {
type: 'ajax',
url: 'http:/.../initpicker.php',
reader: {
type: 'xml',
record: 'root'
}
},
listeners: {
single: true,
datachanged: function(){
var items = [];
store.each(function(r){
stocks.push({text: '<span style="color:Blue;font-weight:bolder;font-size:30px;">'+ r.get('price') +'</span>'});
values.push({text: '<span style="font-weight: bold;font-size:25px;">'+ r.get('investor') +'</span>'});
points.push({text: '<span style="font-weight: bold;font-size:25px;">'+ r.get('event') +'</span>'});
});
}
}
});
store.read();
мой вопрос заключается в том, что если мой XML содержит те же теги, как в пять раз, мы можем по-прежнему разбором данные. , , , .?
я попробовал этот код, но он только проанализирован первый ..........................
если есть любой другой способ, пожалуйста, предложите. , ,
спасибо.
Возможно, вы должны были обновить исходный вопрос. http://stackoverflow.com/questions/4645294/something-wrong-with-my-xml – Hemlock
Нужна помощь по следующей проблеме. Pls помочь http://stackoverflow.com/questions/10971255/read-nested-xml-to-model-with-hasmany-association-sencha-extjs – buddy