Proffesional ASP XML Book- Help with error
Hi everyone!
On chapter 6 there's an error running displaycontacts.asp:
Microsoft VBScript (0x800A01A8)Error, An object is required. Line 22.
Anyone have the same problem? Here is the code:
<%
Dim sourceFile, source, rootElement, HTMLCode
' Set the source of XML here
'sourceFile =
' Create an instance of the XML parser and load the XML into the DOM
Set source = Server.CreateObject("Microsoft.XMLDOM")
source.async = false
source.load (Server.MapPath("\ch6\contacts.xml"))
Set rootElement = source.documentElement
' Build the string that will be sent to the browser
HTMLCode = HTMLCode & ""
HTMLCode = HTMLCode & rootElement.childNodes(0).text
HTMLCode = HTMLCode & "<P></P><I>"
HTMLCode = HTMLCode & rootElement.childNodes(1).text
HTMLCode = HTMLCode & "</I><P></P>"
HTMLCode = HTMLCode & rootElement.childNodes(2).text
HTMLCode = HTMLCode & "<P></P>"
Response.Write HTMLCode
Set source = nothing
%>
Thanks,
Pattri
|