The ASP page that was originally running normally suddenly prompted today:
The code copy is as follows:
Microsoft VBScript Runtime Error '800a01a8'
Missing object: 'xmlDoc.documentElement'
/work/Menu.asp, line 80
The relevant code is found as follows:
The code copy is as follows:
Set xmlDoc=Server.CreateObject("MicroSoft.XmlDom")
xmlDoc.async = false
xmlDoc.load(Server.MapPath("Menu.xml"))
Set root = xmlDoc.documentElement.selectSingleNode("//index")
Could it be that the load was not successful? See the output content:
The code copy is as follows:
Response.Write(xmlDoc.xml)
If it is empty, it must be that something has happened to the load. After checking Menu.xml, I found that the content of the xml file was changed at some point:
The code copy is as follows:
<?xml version="1.0" encoding="gb2312"?>
<index>
<catalog>
<item id="class1_1"><![CDATA[<a href="class1_1.asp" target="main">Subclass 11</a>]]></item>
<item id="class1_2"><![CDATA[<a href="class1_2.asp" target="main">Subclass 12</a>]]></item>
</catalog>
</index>
><![CDATA[<a href="class2_3" target="main">Subclass 23</a>]]></item>
</catalog>
</index>
It will be normal to modify the xml file and then browse the page.