Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Alberto Giolito on Jan 14, 2010 02:45
open dhtmlx forum
dhtmlxtree XML reffers to not existing parent

Hi

I have controlled my source code:

This is the html source:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" href="/css/style.css" type="text/css">
<link rel="stylesheet" href="/js/dhtmlx/Tree/dhtmlxtree.css" type="text/css">

<script src="/js/dhtmlx/dhtmlxcommon.js"></script>
<script src="/js/dhtmlx/Tree/dhtmlxtree.js"></script>

</head>
<body>


<DIV id="treeBox" bgcolor="#FFFFFF" style="WIDTH:100%;height:100%;"></div>

<script>
        tree=new dhtmlXTreeObject(document.getElementById('treeBox'),"100%","100%",0);
        tree.setImagePath("/images/tree/");
        tree.enableCheckBoxes(false);
        tree.enableDragAndDrop(false);
        tree.deleteChildItems(0);
        tree.loadXML("/bin/listini/treeLGTest.php");
        tree.enableIEImageFix(true);
        tree.preventIECaching(true);

    </script>
</body>
</html>
-----------
This is the source of treeLGTest.php:

<?php
header("Content-type: text/xml");
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
echo '<tree id="0">';
echo '<item text="Item0" child="0" id="TLM_01_01_150_" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_150_</userdata>';
echo '</item>';
echo '<item text="Item1" child="1" id="TLM_01_01_150_C" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_150_C</userdata>';
echo '</item>';
echo '<item text="Item2" child="2" id="TLM_01_01_198_" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_198_</userdata>';
echo '</item>';
echo '<item text="Item3" child="3" id="TLM_01_01_199_" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_199_</userdata>';
echo '</item>';
echo '<item text="Item4" child="4" id="TLM_01_01_199_L" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_199_L</userdata>';
echo '</item>';
echo '<item text="Item5" child="5" id="TLM_01_01_135_2" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_135_2</userdata>';
echo '</item>';
echo '<item text="Item6" child="6" id="TLM_01_01_194_1" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_194_1</userdata>';
echo '</item>';
echo '<item text="Item7" child="7" id="TLM_01_01_186_1.006" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_186_1.006</userdata>';
echo '</item>';
echo '<item text="Item8" child="8" id="TLM_01_01_119_" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_119_</userdata>';
echo '</item>';
echo '<item text="Item9" child="9" id="TLM_01_01_189_2" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_189_2</userdata>';
echo '</item>';
echo '<item text="Item10" child="10" id="TLM_01_01_169_" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_169_</userdata>';
echo '</item>';
echo '<item text="Item11" child="11" id="TLM_01_01_169_9.006" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_169_9.006</userdata>';
echo '</item>';
echo '<item text="Item12" child="12" id="TLM_01_01_188_6" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_188_6</userdata>';
echo '</item>';
echo '<item text="Item13" child="13" id="TLM_01_01_300_" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_300_</userdata>';
echo '</item>';
echo '<item text="Item14" child="14" id="TLM_01_01_189_" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_189_</userdata>';
echo '</item>';
echo '<item text="Item15" child="15" id="TLM_01_01_187_5.001" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_187_5.001</userdata>';
echo '</item>';
echo '<item text="Item16" child="16" id="TLM_01_01_179_1" im0="folder.gif" im1="folder.gif" im2="folder.gif">';
echo '<userdata name="url">/bin/listini/treeLG.php?azione=versioni&codice=TLM_01_01_179_1</userdata>';
echo '</item>';
echo '</tree>';
exit;
?>
-----

when i execute the html the error is: "XML reffers to not existing parent";

whats the problem??

Thanks

Alberto Giolito
Answer posted by Stanislav (support) on Jan 14, 2010 02:56
You have "&" chars in XML, which are breaking xml syntax, you need to replace them with &amp;