Xml refers to non existing parent - NO Answer in other subj

I keep getting the xml refers to non existing parent and incorrect XML. The XML is correct, because I tested it with Poster and with the browser and validator. What am i missing?

This is my XML (it passes when I send it by itself):

<tree id="0">
<item text="testing" id="t899888" open="1" im0="gobe.png" im1="green_button.png" im2="globe.png" im5="accept.png" aCol="green" call="1" select="1">
<item text="gr_11444" id="gr_11" open="1" im0="accept.png" im1="up.png" im2="down.png" aCol="blue">
<item text="011691000157100" id="k1hi6ae6p6b5912iv7q1a96if0_0" checked="1">
<userdata name="deviceID">sgdemo01</userdata>
<userdata name="imei_num">011691000157100</userdata>
</item>
<item text="imei_1000151954" id="k1hi6ae6p6b5912iv7q1a96if0_1" checked="1">
<userdata name="deviceID">sgdemo03</userdata>
<userdata name="imei_num">imei_1000151954</userdata>
</item>
</item>
</item>
</tree>

This is how I call it:

		var tree = layout.cells("b").attachTree(0);
		tree.setSkin('dhx_skyblue');
		tree.setImagePath("dhtmlx/imgs/csh_bluebooks/");
		tree.EnableDynamicLoading = true;
		tree.enableCheckBoxes(true);
		tree.enableThreeStateCheckboxes(true);
		tree.loadXML("db/location_xml.php?xmlType=tree");

I have Debug ON and this is what It gives me:

Not an XML, probably incorrect content type specified ( must be text/xml ), or some text output was started before XML data
Loading: db/location_xml.php?xmlType=tree
Status: 404
Response: <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Object not found!</title>
<link rev="made" href="mailto:postmaster@localhost" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}

/*]]>*/--></style>
</head>
<body>
<h1>Object not found!</h1>
<p>
    The requested URL was not found on this server.
    The link on the
    <a href="http://localhost/myWeb/servoTrack/">referring
    page</a> seems to be wrong or outdated. Please inform the author of
    <a href="http://localhost/myWeb/servoTrack/">that page</a>
    about the error.
</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:postmaster@localhost">webmaster</a>.
</p>
<h2>Error 404</h2>
<address>
<a href="/">localhost</a>

  <span>1/15/2011 1:42:45 PM

  Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1</span>
</address>
</body>
</html>

I had that error when I took out the <?xml version='1.0' encoding='iso-8859-1'?> from the top of my xml. I knew I had a problem when the sample xml from the dhtmlx site would not work without it.

I am trying to get xml containing google map coodinates from a java servlet using ajax and build the tree with it. I usually only do java so this is a pain.

Best of luck!

Thanks Thomas, but when you put it back, did it work? For me it doesn’t even work with it.

I have Debug ON and this is what It gives me:
According to debug, xml request return error 404 page
Be sure that php script is really exist in the specified location.

PHP script does exist. The data itself is bad. Any other ideas?

The above log states 404 error
If that problem was resolved, and message still appears - it possible that the top level tag has incorrect id

Normally it is

where 0 - id to which loaded list of items will be appended ( 0 - virtual root item )

The id is explicitly assigned 0. when I run the url directly with Poster I get a good result of xml.

If you run url directly - did browser colors is as xml or shows as plain text

There are two possible problems with xml parsing which may lead to incorrect xml processing

  • incorrect content-type, must be text/xml
  • some whitespaces before <?xml tag

in both cases xml may look as valid one, but browser will not be able to parse it

The XML is fine. I even use the same XML to render the grid.

If issue still occurs for you - please provide any kind of sample or demo link where it can be reconstructed.