Categories | Question details Back To List | ||
[dhtmlxgrid] XML Loading Error Hello. I'm a pro user of dhtmlxgrid and have a question on dhtmlxdataprocessor. This is the test code I wrote to update data. --------------------------------------------------------- header("Content-type: application/xhtml+xml"); echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"); echo "<data>"; if($newId!=0){ print("<action type='".$action."' sid='".$_GET["gr_id"]."' tid='".$newId."'/>"); }else{ print("<action type='error'>SQL query error</action>"); } echo "</data>"; --------------------------------------------------------- This runs correctly on IE6, but doesn't on Firefox3 and Safari3. Debug message on Firefox3 and Safari is here. -------------------------------------------------------- XML status: incorrect Server response: <?xml version="1.0" encoding="iso-8859-1"?> <data><action type='error'>SQL query error</action></data> -------------------------------------------------------- I have no idea what I should correct because it seems to be correct xml to my eyes. Do you think you could help me? Answer posted by Support on Aug 27, 2008 02:28 >>XML status: incorrect such message occurs when browser was not able to parse server side response as valid XML There are two things which can be touched a) content type - while application/xhtml+xml must be safe, try to use text/xml instead of it b) whitespaces before <?xml output , doublecheck that your code doesn't generate them As issue still occurs , you can open the same url as used by dataprocessor ( must be shown in one of debug messages ) in separate FF window - browser must show short synopsis of XML error, include the reason of error. Answer posted by Kei Oikawa on Aug 27, 2008 08:38 Many thanks. I tried to use "text/xml" in content type as you suggested and it worked perfectly. Although I'm not quite sure why "application/xhtml+xml" must be safe, I think it is reasonable enough to use "text/xml" instead because it works properly on IE6, Safari3 and Firefox3. DHTMLXGrid is very very powerful, easy to use, and easy to customize. Also, quick support on this forum is attractive. Surprisingly, just 15 min after I posted my question, it was solved. Superb! Thank you. Answer posted by Support on Aug 27, 2008 10:13 The text/xml is definitelly more common content-type, and it stable works for all supported browsers. application/xhtml+xml is lesser supported content-type, it may not work for some older versions of browser, but while used in local samples it works in latest versions of IE and FF, maybe it is not correct for different platforms ( local test was done on Windows box ) |