0
我已經搜索了許多有關讀取XML文件的示例和教程,但我無法從單個XML文檔中提取值。我覺得我對Value,SingleNode,Text等聲明感到困惑。從XML中提取值失敗
<?xml version="1.0" encoding="utf-8"?>
<resultObj>
<result>False</result>
<invoiceNumber>1</invoiceNumber>
<invoiceDate>2016/05/18 08:26:35</invoiceDate>
</resultObj>
的VBScript(經典ASP)來讀取結果:
Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument")
xmlDOM.async = False
xmlDOM.setProperty "ServerHTTPRequest", True
xmlDOM.Load("file.xml")
Set myroot= xmlDOM.selectSingleNode("/resultObj/result")
response.write myroot.Text
錯誤在最後一行:
Microsoft VBScript運行時錯誤 '800a01a8'
所需的對象
謝謝你這麼多。我發佈了一個與此相關的新問題。請檢查是否可以幫助.http://stackoverflow.com/questions/37339797/loading-xml-file-from-httprequest-output –