XMLHttp updated

This is an update for our moreover script , this uses the newer version of Microsofts XMLHttp component which has got improved performance . The original script can be found here .

Code

<%
' define the variables
dim objHTTP , objXML , objXSL
'create an instance of the xmlHTTP object
'old version use if you do not have the newer version
'Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
'new version bettter performance
Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
' get the requested XML data from moreovers website
' you can get more examples at http://w.moreover.com/categories/category_list_xml.html
objHTTP.open "GET", "http://p.moreover.com/cgi-local/page?c=Webmaster%20tips&o=xml", false
objHTTP.send
' save the XML in the objXML object as XML
set objXML = objHTTP.responseXML
'create an instance of the DOM obdct
set objXSL=Server.CreateObject("microsoft.xmldom")
objXSL.async=false
' load the XSL style sheet into the objXSL object
objXSL.load(Server.MapPath("moreover.xsl"))
' check for errors in the XSL
if (objXSL.parseError.errorCode = 0) then
' parse the XML with the XSL file
Response.Write(objXML.transformnode(objXSL))
else
'if an error occurs, report it
Response.Write "Error: " & objXSL.parseError.reason & "<br> URL:" & objXSL.url
end if
'destroy the objects
Set objHTTP = Nothing
Set objXML = Nothing
Set objXSL = Nothing
%>

 

Sponsors

Books

cover

ASP 3.0 Programmer's Reference