[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 “”;

if($newId!=0){

    print("");

}else{

    print(“SQL query error”);

}

echo “”;

---------------------------------------------------------

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"?>

SQL query error

--------------------------------------------------------



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?

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.

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.

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 )