dhtmlxGrid dhtmlxdataprocessor ASP.NET Web service - grid er

Is there something wrong with the XML being returned to dhtmlxgrid from a Web Service running under ASP.NET?



I am using professional dhtmlgrid version v.1.3 along with dhtmlxdataprocessor. I am also using an ASP.NET web service running under the DotNetNuke portal to retrieve my data. The web service is successfully called and returns the following data in the text field of the xmlDoc object:



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



1Unknown10

2Unknown01





The xml field of the xmlDoc object contains:

<?xml version=\"1.0\"?>

<string xmlns=“http://webservices.DotNetNuke.com/”><?xml version=\"1.0\" encoding=\"UTF-8\"?><row id=“1”>1Unknown10<row id=“2”>2Unknown01



dhtmlxgrid then throws and error in the following function.

The following line fails because top[0] is null (see //DJB ***)

pid=(top[0].getAttribute(“parent”)||0);





dhtmlXGridObject.prototype.parseXML = function(xml,startIndex){

this._xml_ready=true;

var pid=null;

var zpid=null;

if(!xml)

try{

var xmlDoc = eval(this.entBox.id+"_xml").XMLDocument;

}catch(er){

var xmlDoc = this.loadXML(this.xmlFileUrl)

}

else{

if(typeof(xml)==“object”){

var xmlDoc = xml;

}else{

if(xml.indexOf(".")!=-1){

if(this.xmlFileUrl=="")

this.xmlFileUrl = xml

var xmlDoc = this.loadXML(xml)

return;

}else

var xmlDoc = eval(xml).XMLDocument;

}

}

var ar = new Array();

var idAr = new Array();



var a_top=this.xmlLoader.doXPath("//rows",xmlDoc);



if (a_top[0] && a_top[0].getAttribute(“total_count”))

this.limit=a_top[0].getAttribute(“total_count”);



//#config_from_xml:20092006

//head

var hheadCol = this.xmlLoader.doXPath("//rows/head",xmlDoc);

if (hheadCol.length)

this._parseHead(hheadCol);

//#)



var tree=this.cellType._dhx_find(“tree”);

var rowsCol = this.xmlLoader.doXPath("//rows/row",xmlDoc);

if(rowsCol.length==0){

this.recordsNoMore = true;

var top=this.xmlLoader.doXPath("//rows",xmlDoc);

var pid=(top[0].getAttribute(“parent”)||0); // DJB *****FAILS because top[0] is NULL **

if ((tree!=-1)&&(this.rowsAr[pid])){

var tree_r=this.rowsAr[pid].childNodes[tree];

tree_r.innerHTML=tree_r.innerHTML.replace(//(plus).gif/,"/blank.gif");

}

}

else{

pid=(rowsCol[0].parentNode.getAttribute(“parent”)||null);

zpid=this.getRowById(pid);

if (zpid) zpid._xml_await=false;

else pid=null;

startIndex=this.getRowIndex(pid)+1;

}



//global(grid) user data

var gudCol = this.xmlLoader.doXPath("//rows/userdata",xmlDoc);

if(gudCol.length>0){

if (!this.UserData[“gridglobaluserdata”])

this.UserData[“gridglobaluserdata”] = new Hashtable();

for(var j=0;j<gudCol.length;j++){

this.UserData[“gridglobaluserdata”].put(gudCol[j].getAttribute(“name”),gudCol[j].firstChild?gudCol[j].firstChild.data:"");

}

}

//rows

if (tree==-1) tree=this.cellType._dhx_find(“3d”);

if (this._innerParse(rowsCol,startIndex,tree,pid)==-1) return;

if (zpid) this.expandKids(zpid);



if(this.dynScroll && this.dynScroll!=‘false’){

this.doDynScroll()

}

if (tree!=-1){

var oCol = this.xmlLoader.doXPath("//row[@open]",xmlDoc);

for (var i=0; i<oCol.length; i++)

this.openItem(oCol[i].getAttribute(“id”));

}

this.setSizes();

if (_isOpera){

this.obj.style.border=1;

this.obj.style.border=0;

}

this._startXMLLoading=false;

this.callEvent(“onXLE”,[this,rowsCol.length]);

}

The described error means that XML parser was unable to find top “rows” tag in parsed XML, but in same time XML have correct syntax.
So far - this is first report of such problem, if problem still occurs for you - please contact us at dhtmlx@scbr.com and provide the URL which generates such incorrect XML response - so the problem may be reconstructed and investigated.

It is apparent to me that there is a problem parsing the XML.  I will work at providing a URL for test.
Thank You for your response.  I look forward to resolving this issue
Sincerely
Dan

I just want to add that I get the same error: 

var pid=(top[0].getAttribute(“parent”)||0); // DJB *****FAILS because top[0] is NULL **


I am also using ASP.NET 2.0 and only get this error in FireFox on a remote server, works on my local machine using FF.  Was there a fix for this? 

Thanks.

Such error can appear if incoming data is not a valid XML file ( the problem is not related to dataprocessor )
Please check
    dhtmlx.com/docs/products/dhtmlxG … rt_comprob