ASP運(yùn)行出錯(cuò):缺少對(duì)象: 'xmlDoc.documentElement'錯(cuò)誤解決方法
更新時(shí)間:2012年03月01日 20:02:45 作者:
ASP運(yùn)行出錯(cuò):缺少對(duì)象: 'xmlDoc.documentElement'錯(cuò)誤解決方法,需要的朋友可以參考下
原本運(yùn)行正常的ASP頁面,今天突然提示:
Microsoft VBScript 運(yùn)行時(shí)錯(cuò)誤 錯(cuò)誤 '800a01a8'
缺少對(duì)象: 'xmlDoc.documentElement'
/work/Menu.asp,行 80
找到相關(guān)代碼如下:
Set xmlDoc=Server.CreateObject("MicroSoft.XmlDom")
xmlDoc.async = false
xmlDoc.load(Server.MapPath("Menu.xml"))
Set root = xmlDoc.documentElement.selectSingleNode("http://index")
會(huì)不會(huì)是沒有l(wèi)oad成功呢?輸出內(nèi)容看下:
Response.Write(xmlDoc.xml)
空的,能肯定是load出問題了。查看下Menu.xml,發(fā)現(xiàn)xml文件內(nèi)容不知什么時(shí)候被改了:
<?xml version="1.0" encoding="gb2312"?>
<index>
<catalog title="分類一">
<item id="class1_1"><![CDATA[<a href="class1_1.asp" target="main">子類11</a>]]></item>
<item id="class1_2"><![CDATA[<a href="class1_2.asp" target="main">子類12</a>]]></item>
</catalog>
</index>
><![CDATA[<a href="class2_3" target="main">子類23</a>]]></item>
</catalog>
</index>
修改下xml文件,再瀏覽頁面就正常了。
復(fù)制代碼 代碼如下:
Microsoft VBScript 運(yùn)行時(shí)錯(cuò)誤 錯(cuò)誤 '800a01a8'
缺少對(duì)象: 'xmlDoc.documentElement'
/work/Menu.asp,行 80
找到相關(guān)代碼如下:
復(fù)制代碼 代碼如下:
Set xmlDoc=Server.CreateObject("MicroSoft.XmlDom")
xmlDoc.async = false
xmlDoc.load(Server.MapPath("Menu.xml"))
Set root = xmlDoc.documentElement.selectSingleNode("http://index")
會(huì)不會(huì)是沒有l(wèi)oad成功呢?輸出內(nèi)容看下:
復(fù)制代碼 代碼如下:
Response.Write(xmlDoc.xml)
空的,能肯定是load出問題了。查看下Menu.xml,發(fā)現(xiàn)xml文件內(nèi)容不知什么時(shí)候被改了:
復(fù)制代碼 代碼如下:
<?xml version="1.0" encoding="gb2312"?>
<index>
<catalog title="分類一">
<item id="class1_1"><![CDATA[<a href="class1_1.asp" target="main">子類11</a>]]></item>
<item id="class1_2"><![CDATA[<a href="class1_2.asp" target="main">子類12</a>]]></item>
</catalog>
</index>
><![CDATA[<a href="class2_3" target="main">子類23</a>]]></item>
</catalog>
</index>
修改下xml文件,再瀏覽頁面就正常了。
相關(guān)文章
在ASP中不用模板生成HTML靜態(tài)頁直接生成.html頁面
有沒有辦法不用模板,如一個(gè)正常的htmer.asp頁面,直接生成為htmer.html頁面呢?當(dāng)然是可以的,而且非常簡(jiǎn)單,今天就教大家在ASP中不用模板生成HTML靜態(tài)頁的方法2014-09-09如何使用ASP設(shè)置指定站點(diǎn)CPU最大使用程度
如何使用ASP設(shè)置指定站點(diǎn)CPU最大使用程度...2007-01-01asp在iis7報(bào)錯(cuò)行號(hào)不準(zhǔn)問題的解決方法
這篇文章主要介紹了asp在iis7報(bào)錯(cuò)行號(hào)不準(zhǔn)問題的解決方法,需要的朋友可以參考下2020-08-08捕捉并保存ASP運(yùn)行錯(cuò)誤的函數(shù)代碼
捕捉并保存ASP運(yùn)行錯(cuò)誤的函數(shù)代碼,需要獲取asp代碼運(yùn)行錯(cuò)誤的朋友可以參考下2012-03-03asp 實(shí)現(xiàn)對(duì)SQL注入危險(xiǎn)字符進(jìn)行重編碼處理的函數(shù)
asp 實(shí)現(xiàn)對(duì)SQL注入危險(xiǎn)字符進(jìn)行重編碼處理的函數(shù)...2007-08-08asp ajax注冊(cè)驗(yàn)證之 防止用戶名輸入空格
注冊(cè)驗(yàn)證之防止用戶名輸入空格,asp批量替換特殊字符函數(shù)代碼2009-08-08