Invalid XML

I am evaluating your product and cannot get my first grid to work. Javascript is:



mygrid = new dhtmlXGridObject(‘gridbox’);

alert(‘Running Script’);

mygrid.imgURL = “images/”;

mygrid.setHeader(“Property,C1_C4,#cspan,C5S,#cspan”);

mygrid.attachHeader("#rspan,Input,Calc.,Input,Calc.");

mygrid.setInitWidths(“200,100,100,100,100”);

mygrid.setColAlign(“left,right,right,right,right”);

mygrid.setColTypes(“ro,ro,ro,ro,ro”);

mygrid.setColSorting(“str,int,int,int,int”);

mygrid.init();

mygrid.loadXML(“griddata/grid.xml”);



and the XML is:



<?xml version="1.0" encoding="iso-8859-1"?>





Cut Type

Contiguous

Contiguous

Contiguous

Contiguous





Cut Status

Ready

Ready

Ready

Ready





Percent weight yield

1.15

1.14996093971

1.09

1.08996297764





Component composition by weight_Methane

0.01

0.862068965517

 

 





Component composition by weight_Ethane

0.02

1.72413793103

 

 





Component composition by weight_Propane

0.23

19.8275862069

 

 





Component composition by weight_Iso butane

0.19

16.3793103448

 

 





Component composition by weight_N butane

0.71

61.2068965517

 

 





Component composition by weight_N pentane

 

 

1.09

100







On the screen I see the column headings and then the message I get is “Invalid XML” and the table contents don’t display.



Any ideas?

Please check attached sample - it uses code and XML from you snippet and it works fine
“Invalid XML” message means that your XML can’t be correctly parsed - are you loading it from static XML file or from server side script.
In second case script must set correct content - type ( text/xml ) and no whitespaces before <?xml tag.

Also if you loading data from local filesystem ( not http:// but C:/some… ) there is a limitation for IE , in such mode it able to parse only UTF-8 based XML ( if page loaded by http:// any encoding can be used )

1195046937.ZIP (54.6 KB)


I discovered that the error was that I was using ampersand nbsp; in a cell instead of leaving it blank or just putting in a space.  When posing the question here, your system changed the codes into a space which is why it worked for you.



Thanks for your prompt reply though.

If you need to use & in cell value you can do in one of two next way

quoting
&nbsp;

escaping by cdata