Issue with Tree Loading

Hi,

I’m trying to extend a DHTMLX demo application (dhtmlx.com/docs/products/dem … index.html), but I’m getting 2 error message boxes:

  1. “Error Type: LoadXML, Description: Incorrect XML”
  2. “Error type: DataStructure, Description: XML refers to not existing parent”.

I believe the paths for the 2 PHPs in the 3 files below are correct - I’ve already verified. The errors are shown when executing myTree.loadXML(“xml/directoryTree.php”); in the file index.html shown below:

File: index.html
function doOnLoad() {

myTree = myLayout.cells(“a”).attachTree(“0”);
myTree.setImagePath(“imgs/”);
myTree.setXMLAutoLoading(“xml/directoryTree.php”);
myTree.loadXML(“xml/directoryTree.php”);

}

File: directoryTree.php

<?php require_once("../config.php"); ... ?>

File config.php

<?php $gl_starting_directory = "/usr"; $gl_file_types = array("txt"=>"Text File","gif"=>"GIF Image","doc"=>"Word Document","html"=>"HTML Document"); ?>

Any help is much appreciated,
Thanks,
Dhanan.

Hi,

The error occurs when xml or path to it is incorrect.

Here is the article that may help to solve the problem
docs.dhtmlx.com/doku.php?id=othe … orrect_xml

Hi,

Thanks but I’ve seen this article before. I’m trying to load a PHP using loadXML() and it is from the guide at dhtmlx.com/docs/products/dht … mlx20.html, at Step 9. The directoryTree.php comes from dhtmlx20_tutorial.zip downloaded from this page.

If you could suggest what is wrong in loading this PHP, or any alternative to using this PHP, that’d be great.

Thanks,
Dhanan.

a)
in directoryTree.php, replace

if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) { header("Content-type: application/xhtml+xml"); } else { header("Content-type: text/xml"); }

with

header("Content-type: text/xml"); 

b) if it still doesn’t help , in the same file , remove the next line

echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"); 

c) be sure that path in config.php is valid, and target directory contains valid file names.

Hi,

Thanks for the input. I got it to work w/o these changes but by doing the following:

  1. Installed WAMP server for PHP and put directoryTree.php under “C:\wamp\www”.
  2. Specified full HTTP path for loading. Now it depends on WAMP to create the XML, which is then loaded.
    myTree.setXMLAutoLoading(“http://localhost/directoryTree.php”);
    myTree.loadXML(“http://localhost/directoryTree.php”);

Question: Is it possible to remove the dependency on PHP server (by either having a JSP equivalent of these PHP files or by some other means)?

Thanks,
Dhanan.

Hi,

we don’t have other versions of the demo. However, there is java connector:

dhtmlx.com/docs/products/dhtmlxC … ndex.shtml