XML Loading Errors

Dear All,

Can any one spot my mistake. I am sure it obvious but i just can see it. I am get two errors in quick succession

LoadXML incorrect XML
DataStructrer XML refers to non existent server

<div id="navigation_tree" style="width: 100px;height: 650px; overflow: auto"></div>
              <script>
                function treeMenuSelect (nodeId){
                  if(nodeId != 'home'){
                    if(nodeId.indexOf('project_') == 0){
                      pos = nodeId.indexOf('_');
                      id = nodeId.substr(pos+1);
                      window.location.replace('/projects/'+ id);
                    }

                    if(nodeId.indexOf('iteration_') == 0){
                      pos = nodeId.indexOf('_');
                      id = nodeId.substr(pos+1);
                      window.location.replace('/projectiterations/'+ id);

                    }
                    if(nodeId.indexOf('activity_') == 0){
                      pos = nodeId.indexOf('_');
                      id = nodeId.substr(pos+1);
                      window.location.replace('/projectactivities/'+ id);


                    }
                  }
                }

                tree=new dhtmlXTreeObject("navigation_tree","100%","100%",0);
                tree.setImagePath("/images/");
                tree.enableCheckBoxes(false);
                tree.enableDragAndDrop(false);
                //tree.enableSmartXMLParsing(true);

                //tree.onSelect("treeMenuSelect")
                //link tree to controler
                tree.setXMLAutoLoading("/MetaPM/navigation/navdata.xml");
                //load first level of tree
                tree.loadXML("/MetaPM/navigation/navdata.xml?id=0");
                tree.attachEvent("onSelect",treeMenuSelect);
            </script>

the xml returned is

?xml version='1.0' encoding='iso-8859-1'?>
<tree id="0">
<item text="Projects" id="home" open="1" im0="icons/layers.png" im1="icons/layers.png" im2="icons/chart_organisation.png" call="1" select="1">

    <item text="name" id="project_1" im0="icons/report.png" im1="icons/report.png" im2="icons/report.png" open="1"    ></item>
 
    <item text="second project" id="project_2" im0="icons/report.png" im1="icons/report.png" im2="icons/report.png" open="1"    ></item>
 
</item>
</tree>

any clues gratefully received, i have been banging my head all afternoon on this one :cry:

Julian

Hello,

the provided xml is correct (except ?xml version=‘1.0’ encoding=‘iso-8859-1’?> instead of <?xml version='1.0' encoding='iso-8859-1'?>). I’ve attached this xml.

However please check the following article. Possibly I’ll help to resolve the problem:
docs.dhtmlx.com/doku.php?id=othe … orrect_xml
test.zip (320 Bytes)

Alexandra

I wish it was that simple. the missing ‘<’ was from cut and paste it is in facet in the response.

what i have also discovered is that there is no problem in opera 10.10. but it fails in firefox 3.6.3 and safari 4.0.5 and chrome.

I have a feeling the problem might be to do with mime types.

Julian

Have you tried to load the xml file that I attached in the previous answer ? Doesn’t it work ?

I can confirm that it was the mime type. adding

 <%@ page contentType="text/xml; charset=UTF8" %>

to the top of the grails gsp file resolved the issue.

many thanks all

Julian