loadXML not working

When I using loadXML function I got two alert messages



1) Error type:LoadXML

Descriptin :Incorrect XML



2) Error type:DataStructure

Descriptin :XML refers to not existing parent



I have write data to file while calling an ajax function (using java) and then loading this file in a treegrid using “loadXML”.



The file is like this



<?xml version='1.0' encoding='UTF-8'?>



    



            

                

            

        

    

Please be sure that xml file really exists in moment when loadXML called

If you are loading not from static XML file, please be sure
    - content outputed with text/xml content type
    - there are no unnecessary whitespaces before <?xml tag

You can use debug version of dhtmlxcommon.js to check exact server side response.
    dhtmlx.com/docs/products/kb/inde … tmlxcommon

Was curious if the original poster figured out the issue. I’m having similar problem as well.

Hello.
I had same problem.
I was using php-generated XML file, probably this one was throwing the error,
later I have added:
header(“Content-type: text/xml”);
and the problem was solved!

Good luck!
Lovely products out here:)

Common problems and their solutions mentioned here - [dhtmlx.com/docs/products/dhtmlxG … t_comprob(](http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Common_Problems_in_Grid.html#grid_art_comprob() article is grid related, but XML related tips are common for all dhtmlx components )