Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Joe on Feb 13, 2008 05:53
open dhtmlx forum
XML reffers to not existing parent (IE) - dhtmlXTree

I have created PHP that generates XML that is working fine in Firefox. However, when I use the same exact XML for IE, I get the following error:

Error type: DataStructure
Description: XML reffers to not existing parent

I can make the simplest tree in the world and I still get the error. However, if I use the sample xml file, it works fine in both IE and FF.

The PHP code I am using to generate the sample tree is:

header ("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
        
echo "<tree id=\"0\">";
echo "<item text=\"Test\" id=\"test\" />";
echo "</tree>";

This loads the Test item in FF, but errors in IE. Any ideas?

Thanks!
Answer posted by Support on Feb 13, 2008 07:11
Local sample with the same code - works correctly (attached)

Please try to use debug version of dhtmlxcommon.js
    http://dhtmlx.com/docs/products/kb/index.shtml?cat=recent&q=2055
Attachments (1)
Answer posted by Joe on Feb 13, 2008 07:22
The debugging showed something very interesting.  The FF call to tree.loadXML is loading exactly the url I am calling, which returns valid XML.  The IE call to tree.loadXML is adding http://server/path/script?a_dhx_rSeed=1202915960746 to the end of my php script, which causes it to return a 404.  Is there any way to disable it from doing that?

Thanks,
Joe

Answer posted by Support on Feb 13, 2008 07:25
can be disabled by
    tree.preventIECaching(false);

but please beware that IE "like" to cache XML files with the static url
Answer posted by Joe on Feb 13, 2008 07:28
Great, that worked.  I have an unrelated question, I created an equivalent tree with JSON due to my XML problems and it loaded fine in FF but nothing loaded at all in IE (no errors either).  Does JSON only work with FF?  Should I post this as a new question?  I also tried using the sample JSON tree and it worked fine in FF but nothing showed up in IE.
Answer posted by Support on Feb 13, 2008 09:47
loading from JSON works fine from our side
    http://dhtmlx.com/docs/products/dhtmlxTree/samples/json_support/pro_load_json.html

IE is more strict to JSON format ( it doesn't allow trailing commas ) - it may be a reason of problem.
If problem still occurs for you - please provide an example of problematic JSON data.