1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    19
    Vote Rating
    0
    Hasret is on a distinguished road

      0  

    Default Sencha Touch XML Parsing Issue

    Sencha Touch XML Parsing Issue


    I want to parse an xml using sencha touch , i've tried all the possibilities in stckovrflow , but nothing's display :
    XML DATA : from : http://www.aufaitmaroc.com/feeds/maroc.xml
    The store :

    Code:
    
    
    Code:
    Ext.define("MyApp2.store.NewsStore", { extend: "Ext.data.Store", requires: ["Ext.data.proxy.JsonP", "Ext.dataview.List", "MyApp2.model.News"           ,"Ext.data.reader.Xml"],config: {model: "MyApp2.model.News",autoLoad: true,proxy: {    type: 'ajax',    url: 'http://www.aufaitmaroc.com/feeds/maroc.xml',    reader: {        type: 'xml',        record: 'item',        rootProperty: 'channel'        }    }}    });



    I have this errors :


    screen.jpg

    I've tried Yql , but its not stable , it works sometimes , sometimes it doesnt display anything ...

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Location
    Billerica, MA
    Posts
    60
    Vote Rating
    9
    jattardi will become famous soon enough

      1  

    Default


    You're trying to load the file from a different server than your app is running on. This isn't allowed by the browser under normal circumstances.

    Touch is trying to use CORS, but the server doesn't support it. The CORS preflight request makes an HTTP OPTIONS request specifying the different origin. But the web server you're talking to isn't set up to use CORS, so it returns a HTTP 405 (Method Not Allowed).

    If this is a site you control, you can set it up to use CORS. http://enable-cors.org/ is a good site that explains the basics, and it's also covered in the Touch documentation.

    Otherwise, you won't be able to access it directly. The Google Feed API may help you in this circumstance.

Thread Participants: 1

Tags for this Thread