XML and ASP: Retrieve and parse a remote file

后端 未结 6 1474
长情又很酷
长情又很酷 2021-01-05 22:31

I\'m building a site on a Windows Server with ASP enabled. I need to retrieve an XML document from another server and return a value in that document. The xml file is small

6条回答
  •  萌比男神i
    2021-01-05 23:12

    Change line 4 of your original snippet to

    Set objXML = Server.CreateObject("MSXML2.DOMDocument.6.0")
    

    and line 14 to

    Set oRoot = objXML.selectSingleNode("//response")
    

    and you should be fine (assuming your xml is as AnthonyWJones describes).

    Your original //xml/response would get the text from a document that looked like this

    
    
        hello
    
    

提交回复
热议问题