如何在经典asp中读取远程xml文件并将该数据插入数据库
<%
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
文件显示: <一href="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" rel =“nofollow”>http://something.com/rss.xmlhttp://something.com/rss.xml15http://something.com/images/artwork/something.com L_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 阿根廷比索南美洲http://something.com/AED/AUD.aspxf26fa2db-960b-457c-89d2-e9c3b6c16baeSat, 2011年10月22日 07:37:56 GMT1 阿联酋阿联酋航空迪拉姆 = 0.26247 澳大利亚元Oceaniahttp://something.com/AED/BBD.aspxc2a3faff-9c09-4cf6-be98-b6a625f7d971Sat, 22 Oct 2011 07:37:56 GMT1 阿联酋迪拉姆 = 0.54459 巴巴多斯元Nort
<%
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)
%>
output we are getting like below on our classic asp page, that is all raw data,
but it is difficult to separate and insert such data into database..
output.asp file shows:
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, 22 Oct 2011 07:37:56 GMT1 United Arab Emirates Dirham = 1.15256 Argentine PesoSouth Americahttp://something.com/AED/AUD.aspxf26fa2db-960b-457c-89d2-e9c3b6c16baeSat, 22 Oct 2011 07:37:56 GMT1 United Arab Emirates Dirham = 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 responseXml属性,而不是
responseText
。Use the responseXml property, not
responseText
.