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

Classic ASP Feed Reader Problem

Status
Not open for further replies.

GLSmyth

Programmer
Sep 29, 2005
11
US
I am writing a feed reader using Classic ASP and have come across a problem.

Below is the first part of my code, which works just fine for most RSS feeds. However, when I plugged in the value for Feed you see here in the code, the last line bombs with an "Object required" error.

Dim XML, Feed, Text, ItemChild
Feed = "set XML = Server.CreateObject("MSXML2.ServerXMLHTTP")
XML.Open "GET", Feed, False
XML.Send
set objText = XML.ResponseXML
Set XML = nothing
Set htmlElement = objText.documentElement
Set NodeList = htmlElement.getElementsByTagName("item")

The feed does exist, validates and has <item> elements, so I cannot figure out why I am getting the error.

Any help in understanding where the problem lies would be greatly appreciated.

Cheers -

george
 
The reason is that the feed is set to content-type text/html. Hence to load it into dom, you have to do it at the receiving end. Like this.
[tt]
[red]'[/red]set objText = XML.ResponseXML
set objText=server.createobject("msxml2.domdocument")
objText.LoadXml XML.ResponseText
[/tt]
assuming well-formedness etc and all that.
 
Thank you for the help, I appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top