jQWidgets Forums
jQuery UI Widgets › Forums › Plugins › Data Adapter › Getting XML Parsing Error: not well-formed
Tagged: data adapter, load xml file, xml file
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 4 months ago.
-
Author
-
This is the XML I am trying to parse:
<entries><entry> <project>ENVISION</project> <country>Cameroon</country> <region>Centre</region> <district>Sa’A</district> <disease>LF</disease></entry></entries>
It appears to be getting hung up on the apostrophe. Any ideas how to resolve this?
Hi,
Not sure how to reproduce that as I can load that file on my side.
Example:
<!DOCTYPE html><html lang="en"><head> <script type="text/javascript" src="../../scripts/jquery-1.10.1.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript"> $(document).ready(function () { var url = "test.txt"; // prepare the data var source = { datatype: "xml", datafields: [ { name: 'project'}, { name: 'country' }, { name: 'district' }, { name: 'region' }, { name: 'disease' } ], root: "entries", record: "entry", url: url }; var dataAdapter = new $.jqx.dataAdapter(source); dataAdapter.dataBind(); }); </script></head><body class='default'></body></html>
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHello,
I am seeing this problem again. I have provided sample code demonstrating this problem here:
http://jsfiddle.net/apreston/3Pzhj/3/Please advise.
Hi adam,
I do not think that this should work in the way you try to use it. You’re making a Cross-Domain call which will never work in that way due to the browser’s security policies. For Cross-Domain calls, as far as I know, you should use JSONP. We have a sample about that available in the jqxDataAdapter and jqxGrid’s Documentation pages.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThis one works though.
http://jsfiddle.net/apreston/JP59m/1/This one doesn’t work
http://jsfiddle.net/apreston/3Pzhj/6/The only difference is a special character in the xml.
Hi adam,
If you wish, open https://dl.dropboxusercontent.com/u/10706440/why.xml with your browser. As you can see, it is recognized as Invalid XML and as such it can’t be loaded.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.