如何在经典asp中读取远程xml文件并将该数据插入到db中

时间:2011-10-22 12:21:59

标签: xml asp-classic

<%
Set objSrvHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
objSrvHTTP.open "GET", "http://something.com/rss.xml", false

objSrvHTTP.send()
Feed = objSrvHTTP.ResponseText 
response.write("=" & Feed)

%>

输出我们在经典的asp页面上得到如下所示,即所有原始数据, 但很难将这些数据分离并插入数据库..

output.asp文件显示: http://something.com/rss.xmlhttp://something.com/rss.xml15http://something.com/images/artwork/something.comL_sml.jpghttp://something.com/AED/Default.aspxhttp://something.com/AED/ARS.aspx37be012b-06f2-4f88-9768-a432e5c8a240Sat,2011年10月22日07:37:56 GMT1阿拉伯联合酋长国迪拉姆= 1.15256阿根廷PesoSouth Americahttp://something.com/AED/AUD.aspxf26fa2db-960b-457c-89d2-e9c3b6c16baeSat, 2011年10月22日07:格林威治标准时间37:56阿拉伯联合酋长国迪拉姆= 0.26247 Australian DollarOceaniahttp://something.com/AED/BBD.aspxc2a3faff-9c09-4cf6-be98-b6a625f7d971Sat,22 Oct 2011 07:37:56 GMT1 United Arab Emirates Dirham = 0.54459 Barbadian DollarNort

1 个答案:

答案 0 :(得分:0)

使用responseXml属性,而不是responseText