Forum Moderators: open
I am having some issues with this code. My previous supervisor who had worked here coded this. He left and I'm stuck with this issue, since I have no knowledge of RSS Feeds and enough knowledge of ASP to get through the day.
Anyway-- I keep getting this error
---------------------------------------------------
Microsoft VBScript runtime error '800a01a8'
Object required
/news.asp, line 41
---------------------------------------------------
I look at Line 41 and it's this
---------------------------------------------------
for each child in RSSItem.childNodes
---------------------------------------------------
I don't understand why this isn't working! I checked all the variables and they all seem to match. Am I missing something? This is all happening b/c the RSS Feed provider changed around their feed and now everything is f'ed up! PLEASE HELP!
Below is the entire code for the page, with the exceptions of the header and footer includes which is all HTML... no ASP.
---------------------------------------------------
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Set the following to the url of the RSS news feed
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
URLToRSS = "http://www.inman.com/syndication/mlsli/rss.aspx?cust=2464"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Fetch the XML data
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0")
xmlHttp.Open "Get", URLToRSS, false
xmlHttp.Send()
RSSXML = xmlHttp.ResponseText
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Convert to XML object
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set xmlDOM = Server.CreateObject("MSXML2.DomDocument.3.0")
xmlDOM.async = false
xmlDOM.LoadXml(RSSXML)
Set xmlHttp = Nothing
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Find specific article
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
set RSSitem = xmlDOM.SelectSingleNode("channel/item[guid=" & Request("guid") & "]")
Set xmlDOM = Nothing
%>
<table class=bodytext>
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Find the fields of interest
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
for each child in RSSItem.childNodes
Select case lcase(child.nodeName)
case "title"
RSStitle = child.text
case "pubdate"
RSSdate = child.text
case "description"
RSSbody = child.text
case "author"
RSSauthor = child.text
End Select
next
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Display News Article
'' Variables:
''Article Title >> RSStitle
''Article Publication Date >> RSSddate
''Article Body >> RSSbody
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<tr>
<td>
<h3><%=RSStitle%></h3>
<div align="right"><EM><%=RSSdate%></EM><BR> </div>
<strong><%=RSSAuthor%></strong>
<span class=bodytext><%=RSSbody%></span>
</td>
</tr>
</table>
The page that has the listings of all the articles works fine... the "details" page is what's having all the issues...
Article list:
[mlsli.com...]
** Click on ANY title and it will take you to the error...
Any help would be appreciated! :)
I think RSSitem is not returning an object because it's not matching a node, and this appears to be due to a problem with your xpath code here:
set RSSitem = xmlDOM.SelectSingleNode("channel/item[guid=" & Request("guid") & "]") Try:
set RSSitem = xmlDOM.SelectSingleNode("//channel/item[guid=" & Request("guid") & "]")