XML and ASP: Retrieve and parse a remote file

后端 未结 6 1491
长情又很酷
长情又很酷 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条回答
  •  青春惊慌失措
    2021-01-05 23:28

    Assuming your Xml is in fact:-

    
    The value
    

    Try using:-

    Dim value
    value = objXML.documentElement.Text
    

    BTW,

    When you call methods from which you are not returning a value you do not need the brackets:-

    objXML.Load Url
    
    Response.Write objXML.parseError.reason
    

    Also if this is your server, install MSXML6 and use MSXML2.DOMDocument.6.0. IF this is not your server use MSXML3.DOMDocument.3.0

提交回复
热议问题