No data is available for the requested resource
msxml2 DOMDocument 加载失败
使用msxml2.domdocument.3.0对象加载xml文件时失败!提示:No data is available for the requested resource,但是用浏览器打开xml的url地址是能正常现实的。困惑了好久,最终原因是,需要设置msxml2.domdocument对象的ServerHTTPRequest属性为True。看下面例子:
Dim XmlDoc
Set XmlDoc = CreateObject("msxml2.domdocument.3.0")
XmlDoc.ASYNC = False
XmlDoc.SetProperty "ServerHTTPRequest",True
If XmlDoc.Load(http://www.ljf.cn/book.xml) Then
Response.Write("加载成功!")
End If
注意,如果是加载文件,而非url,则不设置这个属性也没有问题。
参考文档:
1、http://support.microsoft.com/kb/281142/zh-cn
2、http://www.cnblogs.com/sunsonbaby/archive/2004/11/10/62160.html

xml 水晶图标