Hi
I’ve adapted your sample JSP example with a servlet but keep getting the infamous ‘Incorrect XML’ error message.
My servlet code is simple and as follows:
String xml = “<?xml version=\"1.0\" encoding=\"UTF-8\"?>hellomr01 Jan 1970”;
response.setContentType(“text/xml”);
response.setHeader(“Cache-Control”, “no-cache”);
response.getWriter().write(xml);
My index.html page is very similar to the one in the example and is as follows:
function doOnLoad(){
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setHeader(“First Name, Title, Date of Birth”);
mygrid.setColTypes(“ed,ed,ed”);
mygrid.setInitWidths(“150,50,100”)
mygrid.setColAlign(“left,left,left”)
mygrid.setColumnColor("#f7f6f0,#ffffff,#f7f6f0")
mygrid.loadXML(loadDataURL);
mygrid.init()
}
From my FireFox 2.0.0.4 debugger i can see the XML returned and it looks ok. Details are as follows:
Response Headers
Date Wed, 13 Jun 2007 06:55:58 GMT
Server Oracle Containers for J2EE
Content-Length 131
Connection Keep-Alive
Keep-Alive timeout=15, max=100
Content-Type text/xml; charset=ISO-8859-1
Cache-Control no-cache
<?xml version="1.0" encoding="UTF-8"?>hello worldmr01 Jan
1970
If i send a request to the same URL from the same html page using a native XMLHttpRequest object i get back a valid XML response. Any ideas?
Thanks in advance.
Basically grid uses the same XMLHttpRequest object, so if it work for normal object it will work for grid as well.
In your case problem caused by XML text itself - grid expects to find standard “//rows/row/cell” structure but instead of it it got “//clients/client/some”
While in theory it possible to adapt grid to different XML schema, without code modification grid will work only with standard XML tag names