Re get data FromSQL 2000 by getUrl tasks

Re get data FromSQL 2000 by getUrl tasks

Hi Akash: 

This is a http link through a query from SQL 2000, and then use the getUrl parse the xml file in the creator, the format is the basic reference creator to help complete the test data seems crawl, but can not display the data and found a different format, as follows

1,the sample from zoho creator


2,the sample from my link

Grab the data format is as follows:


my function code as  follows:
  1. string test()
  2. {
  3.     sm = "<table class=table zc-viewtable>" + "<tr class=zc-row-header>" + "<td class=zc-viewrowheader colspan=5>" + "<center>Display data From SQL 2000</center>" + "</td>" + "<tr class=zc-row-header>" + "<td class=zc-viewrowheader>" + "Address" + "</td>" + "<td class=zc-viewrowheader>" + "Phone No" + "</td>";
  4.     mapvar = getUrl(("http://182.151.69.181/getdata?sql=SELECT * FROM CUSTOMERS FOR XML AUTO&root=root"),false);
  5.     stringdata = mapvar.get("responseText");
  6.     xmldata = stringdata.toXML();
  7.     strdata = xmldata.executeXPath("/root/CUSTOMERS");
  8.     strdata = (strdata).replaceAll("&","and");
  9.     xmllist = strdata.toXmlList();
  10.     for each r in xmllist
  11.     {
  12.         sm = sm + "<tr>" + "<td>" + r.executeXPath("/CUSTOMERS/@Address") + "</td>" + "<td>" + r.executeXPath("/CUSTOMERS/@Phone") + "</td>";
  13.     }
  14.     sm = sm + "</table>";
  15.     return sm;
  16. }
this link is working
http://182.151.69.181/getdata?sql=SELECT * FROM CUSTOMERS FOR XML AUTO&root=root

so could you please help me check where is problem in my function or the link format.

Thanks and waiting your reply

Stnaley Guo

2012-3-26