(Classic ASP) Load XML from a Remote URL
Demonstrates how to load XML from a remote URL, such as https://www.chilkatsoft.com/hamlet.xml
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example assumes the Chilkat HTTP API to have been previously unlocked.
' See Global Unlock Sample for sample code.
set http = Server.CreateObject("Chilkat_9_5_0.Http")
set sbXml = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
' Download the XML from the URL into sbXml
success = http.QuickGetSb("https://www.chilkatsoft.com/hamlet.xml",sbXml)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Response.End
End If
set xml = Server.CreateObject("Chilkat_9_5_0.Xml")
' Load the XML contained in sbXml
success = xml.LoadSb(sbXml,1)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( xml.LastErrorText) & "</pre>"
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( "Success.") & "</pre>"
%>
</body>
</html>
|