Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLDOM object error

Status
Not open for further replies.

damgog

Programmer
Jul 12, 2001
10
IE
I am using an XMLDOC object to get values from an xml document, using the following code:

Set rtnDoc = Server.CreateObject("Microsoft.XMLDOM")
rtnDoc.loadXML(xml.responseText)

Set nodes = rtnDoc.documentElement.childNodes

, but I keep getting the following error:
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'documentElement'

Can anyone please help, before I throw my computer out the window, because this is driving me insane.
I used the documentElement object in some code a few weeks ago and that worked fine then, but that code doesn't work now either.

Thanks.
 
Hello,
Usually error is something before the line where error is complaining.
Try to see what is in xml.responseText
Usually xmlLoad wants as parameter xml file.
If it is something that comes from ASP be sure to have proper content-type of response.
I.e. first line have to be:
<% Response.ContentType = &quot;text/xml&quot; %>
Also try to check if rtnDoc = null
It means that something went wrong and you do not have proper XMLDOMDocument object (documentElement is a property of XMLDOMDocument and tha's why it is complaining about it.)
Hope this helps.
D.
 
I figured out the error. The xml was beign returned properly, but the error occured because of the header on the xml document, ie an invalid tag. I stripped that off and it works fine now.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top