-
20 Jun 2012 10:51 PM #1
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?
-
22 Jun 2012 10:19 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3161
I'm not XML expert (I hugely prefer JSON) but I thought CDATA was like <![CDATA[ ]]>
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
23 Jun 2012 3:32 AM #3
Yes, is <![CDATA[ ]]>. I don't know why the forum has parsed it in that way...
-
18 Oct 2012 12:44 PM #4
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...


Reply With Quote