% Dim objXMLHTTP, xml Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.codetoad.com/", False ' Pull the data from the web page xml.Send
Response.write "Here's the html we now have in our xml object" Response.write "BR>BR>BR>" Response.Write "xmp>" Response.Write xml.responseText Response.Write "/xmp>" Response.write "BR>BR>BR>" Response.write " Now here's how the page looks:BR>BR>" Response.Write xml.responseText
Set xml = Nothing %>
下面是另一個實例
% dim objHTTP , objXML , objXSL set objHTTP = Server.CreateObject("Microsoft.XMLHTTP") objHTTP.open "GET", "http://p.moreover.com/cgi-local/page?c=Pop%20music%20reviewso=xml", false objHTTP.send set objXML = objHTTP.responseXML set objXSL=Server.CreateObject("microsoft.xmldom") objXSL.async=false
objXSL.load(Server.MapPath("style.xsl"))
if (objXSL.parseError.errorCode = 0) then Response.Write(objXML.transformnode(objXSL)) else Response.Write "Error: " objXSL.parseError.reason " URL:" objXSL.url end if
Set objHTTP = Nothing Set objXML = Nothing Set objXSL = Nothing %>