I know that this is a common problem, But I can’t seem to get past it. I am evaluating many of the components here, and I get this error whenever I try and load any XML file from the examples. Datagrid, grid, tree…
I am calling them just as shown in the examples …
mygrid = new dhtmlXGridObject(Div2);
mygrid.setHeader("Column A, Column B");
I have moved the grid.xml file to different directories, thinking that the system can’t find the file. I am using firefox. I think the system can’t find the file. I believe that the same error would also be generated if the file was not found. How can I track this problem down? The Gantt chart example works … but I am not loading any data from a file. In the above example the column headers do print before I get the error. I like your components a lot. I hope I can get this resolved.
these are the libs I am loading
RegisterScript( 'Scripts/dhtmlxcommon.js', 'js', InstanceName );
RegisterScript( 'Scripts/dhtmlxgantt.js', 'js', InstanceName );
RegisterScript( 'Scripts/dhtmlxgrid.js', 'js', InstanceName );
RegisterScript( 'Scripts/dhtmlxgridcell.js', 'js', InstanceName );
Thank in advance.
I got got working. I wrote my own server side file reader. I read the file and send back the file as a string, then call the parse function to load the string into the control. For what I need the controls to do, I had to write a file reader anyway. All is good.
Spoke to soon. The tree control will not load the XML string. Now I get a data structure error. XML refers to non existing parent. My xml string is fine. What can cause this problem?
BTW… your grid control gave me errors too when loading XML string with the
loadXMLString() function. It was not until I used the Parse() function on the grid did my string work. Whats up !!? Should not be so hard to evaluate your controls. A simple forum search shows that these ‘Data’ problems are not new, and an as of yet, not a ‘clear’ answer of what can cause these errors within the different controls. Any insight on the tree control?
Going deeper … actually the xml file was not fine. I used the example file that came with the downloads … ‘tree_b.xml’. Apparently there is an “&” sign in two of the entries within the file. After changing “&” to "and’ the file loaded. Now the problem is how to import files with the “&” sign in them. I changed the header to encoding=“UTF-8”? , and set the tree to tree.setEscapingMode(“utf8”), but it still chokes when loading the file. Here is the error report…
The next error ocured :<br> <strong>DataStructure [XML refers to not existing parent]</strong> in <strong>none</strong> at line <strong>none</strong>
<parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml">XML Parsing Error: not well-formed
Line Number 4, Column 28:<sourcetext> <item text="Mystery !!! & Thrillers" id="mystery" en="1">
Node: 0 Childs: 0
BTW… I am purchasing your controls today. I don’t see any problems that can’t be worked thought. . Nice job with the library.
Now I get a data structure error. XML refers to non existing parent. My xml string is fine. What can cause this problem?
Top element of XML contains reference to parent id
- xml will be parsed and new items will be added to parent item with ID 0
by default 0 is ID of virtual root item ( can be changed by using 4th parameter of constructor )
Error in your case means that tree element contains not existing top id value
xml’. Apparently there is an “&” sign in two of the entries within the file.
File contains only escaped sequences : &
If you are loading data from XML string and placing xml code in the html page before loading - it possible that data double processed - first time as part of html code, second time as part of xml - which is causing the issue.
something like next must be safe
//data in textarea will not be processed by html parser
<textarea id="data" style="display:none">... place xml data here... </textarea>