Dhtmx grid with Oracle and php


below is the code for populating the email table to grid. but i am geting incorrect xml error. can anybody help me please


//include db connection settings

require_once ‘…/adodbcon.php’;

//print tree XML based on parent_id (function calls itself to go through the nested levels)

    function getRowsFromDB($parent_id){

        //get tree level from database taking parent id as incomming argument


        $sql = “SELECT email_id,recipient_id,status,status_cdtyp from email_recipients_hist”;

        //echo $sql;

        $recordset = $conn->Execute($sql);




                //create xml tag for grid row

                print("<row id=’".$recordset->fields[‘email_id’]."’>");




                //close xml tag for the row



        //$mon = 0;



//include XML Header (as response will be in xml format)

if ( stristr($_SERVER[“HTTP_ACCEPT”],“application/xhtml+xml”) ) {

        header(“Content-type: application/xhtml+xml”); } else {

        header(“Content-type: text/xml”);


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




    //print tree XML


    //Close db connection



Reasons of “Incorrect XML” erro could be:
1) XML data is invalid ( invalid structure of XML );
if some kind of server side error occurs, error or debug output may break valid xml data;
2) invalid content type ( must be a text/xml for XML data );
3) whitespaces before <?xml output;
4) not escaped special characters, such as &, <, >;
5) incorrect encoding of data.

1) use debug version of dhtmlxcommon.js , which will show extended error info;
2) load the same URL in separate browser window - it will show reason and location of error;
3) correctly escape special characters in XML data.