1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    18
    Vote Rating
    0
    andrea88v is on a distinguished road

      0  

    Default Unanswered: Read CDATA content in a XML file

    Unanswered: Read CDATA content in a XML file


    Hello! I'm trying to read an XML file that looks like this:



    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <announcements>
        <announcement c_date="2012-06-29T08:00:00+02:00">       
           <title><=!=[=C=D=A=T=A=[Title 1]=]=></title>        
           <description><=!=[=C=D=A=T=A=[Description 1]=]=></description>
        </announcement>
    </announcements>


    It seems that CDATA content is not interpreted by Sencha; there is a function in Sencha for parse CDATA content and a function to read and parse attributes like c_date?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,549
    Vote Rating
    873
    Answers
    3567
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I'm not XML expert (I hugely prefer JSON) but I thought CDATA was like <![CDATA[ ]]>
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    18
    Vote Rating
    0
    andrea88v is on a distinguished road

      0  

    Default


    Yes, is <![CDATA[ ]]>. I don't know why the forum has parsed it in that way...

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Location
    Detroit, MI
    Posts
    15
    Vote Rating
    0
    Nares is on a distinguished road

      0  

    Default Hi...facing same issue Reading XML Error: Unexpected token <

    Hi...facing same issue Reading XML Error: Unexpected token <


    Hi...facing same issue Reading XML Error: Unexpected token <

    Hi,
    I'm facing same issue.
    Accessing http request on cross-domain, and that why using proxy type as jsonp.
    With this I'm getting error as follows.
    Reading XML Error: Unexpected token<my Store:

    config: {


    autoLoad: true,


    model:'myModel',


    storeId:'storeID',


    proxy: {
    type:'jsonp',
    url:'http://domain.com',
    reader: {
    type:'xml',
    rootProperty:'rootProperty' }
    }
    },


    Please note that, XML repsonse from server does contain data with CDATA tag
    Ex:
    <city>
    <![CDATA[CityName]]>
    </city>

    Not sure, error I get is due to a limitation on reader type "xml"

    Please help ...you may like to reach me at lgframe@yahoo.com
    Thanks in advance...

Thread Participants: 2

Tags for this Thread