PDA

View Full Version : Can't load XML



spaceman123
21 Dec 2010, 3:49 AM
I wonder if somebody could help me please. I've trying to load an XML via (via ASP) into an app I'm trying to build, but nothing loads at all although the title of the page does actually change. If I load the ASP file it does display the XML perfectly without any errors. The code I'm using is:

Ext.setup({
onReady: function() {
Ext.regModel('Music', {
fields: ['artist', 'title']
});

var store = new Ext.data.TreeStore({
model: 'Music',
proxy: {
type: 'ajax',
url: 'http://www.domain.com/cd.asp',
reader: {
type: 'tree',
root: 'cd'
}
}
});

var list = new Ext.List({
floating: true,
singleSelect: true,
itemTpl : '{artist} {title}',
store: store,
centered: false

});
list.show();
}
});

and the XML that the ASP file is outputting is:


<?xml version='1.0' encoding='UTF-8'?>
<music>
<cds>
<artist>A HA</artist>
<title><![CDATA[Greatest Hits]]></title>
</cds>
<cds>
<artist>Kate Bush</artist>
<title><![CDATA[Wuthering Heights]]></title>
</cds>
<cds>
<artist>Chris De Burgh</artist>
<title><![CDATA[Spanish Train & Other Stories]]></title></app>
<cds>
<artist>Beatles</artist>
<title><![CDATA[Help]]></title>
</cds>
<cds>
<artist>Dollar</artist>
<title><![CDATA[Oh L'Amour]]></title>
</cds>
<cds>
<artist>Madness</artist>
<title><![CDATA[Divine Madness]]></title>
</cds>
</music>

Thanks for any help.