I am getting an “xml refers to not existing parent” error in FF only (works fine in IE). I’ve looked through the forums and made sure that there is not any whitespace at the beginning of the XML, but cannot find a similar problem. An example of my XML:
99 99 99
The XML code was taken from the page source, but I have trimmed the string that is returned as well.
Please help.
The error mean that after XML loaded the “id” attribute of top tag doesn’t reffer to any existing element in tree, and component doesn’t know in which place of hierarchy new xml must be added.
Default ID of super-root item is 0, so your xml must work.
Check the initialization of you tree, the 4th parameter of constructor is rootID value ( if it is not specified - try to specify it )
some = new dhtmlXTreeObject (element,width, height, 0);
Here’s my code for initializing the tree:
As you can see, I have the 0 in there. Is it version dependant maybe? I’m running FF 2.0.0.6
Thank you for your time.
The code is fully correct , when using your code and XML data with static files all works correctly ( sample attached )
The only reason of problem - your aspx code returns XML in incorrect way.
Please be sure that XML from your aspx script outputed with correct content type ( it must be text/xml )
1197310431.ZIP (39.7 KB)
I fixed it. Was sending the xml out with a response.write. I needed to set the response.contenttype to “text/xml”.
Thank you for your help.