当前位置: 代码迷 >> Java Web开发 >> dhtmltree采取生成好的字符串加载生成树?无法正确加载xml字符串
  详细解决方案

dhtmltree采取生成好的字符串加载生成树?无法正确加载xml字符串

热度:5866   发布时间:2013-02-25 21:07:25.0
dhtmltree采用生成好的字符串加载生成树?无法正确加载xml字符串?
xml字符串ss内容如下
<?xml version="1.0" encoding="iso-8859-1"?>
<tree id="0" >
<item   text="Books" id="books" im0="book.gif" im1="books_open.gif" im2="books_close.gif" child="1">
<item text="Mystery &amp; Thrillers" id="mystery" im0="folderClosed.gif" im1="folderOpen.gif" im2="folderClosed.gif" child="1">
</item>
</item>
</tree>
采用
tree=new dhtmlXTreeObject("doctree_box","100%","100%",1);
tree.setImagePath("<%=request.getContextPath()%>/imgs/"); 
 tree.loadXML(ss);
提示
Errot type:LoadXML 
Description:Incorrect XML 

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


请大家帮忙解决一下。tree Id 和你创建树的Id不同 ,你的 tree ID是0,创建 treeObjectId 为 1
你的问题解决了吗?我也遇到了同样的问题我也遇到了这个问题,你解决了希望能够将方法说下啦~~~
  相关解决方案