Using ASP to receive XML data from a remote server

Source: Internet
Author: User
<%
Dim objxml
Dim objrootelement
Dim strvalue
Dim Strineturl
Dim strxml
Dim item

Strineturl = "Http://pf.inetsolution.com/inetactive2001/inetactive2001news.xml"
Dim Httpreq

Set httpreq = Server. CreateObject ("MSXML2.") XMLHTTP ")

Httpreq.open "Get", "Http://pf.inetsolution.com/inetactive2001/inetactive2001news.xml", False
Httpreq.send
Strxml = Httpreq.responsetext
Set objxml = Server.CreateObject ("Msxml2.domdocument")
Objxml.validateonparse = True
Objxml.async=false
Objxml.loadxml (Strxml)
If ObjXML.ParseError.errorCode <> 0 Then
Response.Write ("Error:" & ObjXML.parseError.reason & "<br>")
Response.Write ("code:0x" & Hex (ObjXML.parseError.errorCode) & "<br>")
Response.Write ("at line:" & ObjXML.parseError.line & "<br>")
Response.Write ("at Pos:" & ObjXML.parseError.linePos & "<br>")

Else
Set objrootelement = Objxml.documentelement
If not IsObject (objrootelement) Then
Response.Write ("No File Loaded")
Else
Response.Write (Objrootelement.childnodes (0). Text)
End If
End If
%>


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.