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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying xml date using asp

Status
Not open for further replies.

daveigh

Programmer
Oct 9, 2003
105
0
0
ive been tinkering with this code & i cant seem to figure out i get this err:

Microsoft VBScript runtime (0x800A01A8)
Object required: 'objNodeXML'
/gaynewsfeed.asp, line 13

here is my code:

XmlFile=Server.MapPath("rssfeed/users.xml")
Session.LCID=2057

Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.SetProperty "ServerHTTPRequest", True
objXML.load(XmlFile)

set objNodeXML=objXML.documentElement
set CurUsers=objNodeXML.selectNodes("item") <==== error line

what do you think guys?


______________CRYOcoustic_____________
 
[1] You use server.mappath, hence, it implies that you have the file on the local. Hence, I would suggest you comment out the .serverhttprequest line.
[2] You have to make sure you have well-formed file. Add some error control.
[tt]
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
with objXML
.async = False
[red]'[/red].SetProperty "ServerHTTPRequest", True
.load(XmlFile)
end with
[blue]if oparser.parseerror.errorcode<>0 then
response.write "xml file " & XmlFile & " is not well-formed or not found." & "<br />" & "Operation aborted."
set objXML=nothing
response.end
end if
[/blue]
[/tt]
 
Amendment
The corresponding line in my post should be read accordingly.
[tt] if [red]objXML[/red].parseerror.errorcode<>0 then
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top