473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem with RSS feed


Hi,
I am trying to incorporate Really Simple Syndicate (RSS) news into my asp
(not asp.net) based website. Since RSS is basically XML, I am trying to open
the xml file and parse it. On Asp.net the following code works seamlessly. I
am running IIS 5.1 on Win Xp Sp1.

----------------------------------------------------------------------------
Dim objXMLNews
set objXMLNews = Server.CreateObject("Msxml2.DomDocument.4.0")
objXMLNews.async = False

objXMLNews.load("http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world
/rss091.xml")

Dim xmlNodeNews
set xmlNodeNews = objXMLNews.documentElement.selectNodes("//item")

Dim xmlNewsItem

For Each xmlNewsItem In xmlNodeNews
Response.Write("<a href='" &
xmlNewsItem.childNodes.Item(2).Text() & "'>")
Response.Write(xmlNewsItem.childNodes.Item(0).Text ())
Response.Write("</a><br/>")
Next
----------------------------------------------------------------------------

However on ASP I get the following error.

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: '[object]'

in this line -> [set xmlNodeNews =
objXMLNews.documentElement.selectNodes("//item")]

Any ideas?

--
----------------
Cheers,
Rajiv Das
Nov 12 '05 #1
5 2090
Well, the link works. I tested it in my own RSS/RDF reader and got no
errors.
What does the "//item" accomplish? Will "item" do the same?

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 12 '05 #2
* Morten Wennevik wrote in microsoft.public.dotnet.xml:
What does the "//item" accomplish? Will "item" do the same?


Selects all item element nodes in the document. "item" will accomplish
the same if all item element nodes are children of the context node.
Nov 12 '05 #3
I want to extract the 'item' node and so I used '//item'
Even removing the // does no good.
--
----------------
Cheers,
Rajiv Das
"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:opryry24k4hntkfz@localhost...
Well, the link works. I tested it in my own RSS/RDF reader and got no
errors.
What does the "//item" accomplish? Will "item" do the same?

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 12 '05 #4
1st.
wrong newsgroup. This is for the .NET XML support, which is in the .NET
base class lib. This group is not for support of MSXML, which is a
different thing. For that you should probably go to microsoft.public.xml
2nd
set xmlNodeNews =
objXMLNews.documentElement.selectNodes("//rss/channel/item")
-Dino
"Rajiv Das" <ra********************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

Hi,
I am trying to incorporate Really Simple Syndicate (RSS) news into my asp
(not asp.net) based website. Since RSS is basically XML, I am trying to open the xml file and parse it. On Asp.net the following code works seamlessly. I am running IIS 5.1 on Win Xp Sp1.

-------------------------------------------------------------------------- -- Dim objXMLNews
set objXMLNews = Server.CreateObject("Msxml2.DomDocument.4.0")
objXMLNews.async = False

objXMLNews.load("http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world /rss091.xml")

Dim xmlNodeNews
set xmlNodeNews = objXMLNews.documentElement.selectNodes("//item")

Dim xmlNewsItem

For Each xmlNewsItem In xmlNodeNews
Response.Write("<a href='" &
xmlNewsItem.childNodes.Item(2).Text() & "'>")
Response.Write(xmlNewsItem.childNodes.Item(0).Text ())
Response.Write("</a><br/>")
Next
-------------------------------------------------------------------------- --
However on ASP I get the following error.

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: '[object]'

in this line -> [set xmlNodeNews =
objXMLNews.documentElement.selectNodes("//item")]

Any ideas?

--
----------------
Cheers,
Rajiv Das

Nov 12 '05 #5
It really sounds like the progID is not there. The following VBScript runs
when you save it as a .VBS file and run it from your desktop:

Dim objXMLNews
set objXMLNews = CreateObject("Msxml2.DomDocument.4.0")
objXMLNews.async = False
objXMLNews.ValidateOnParse = false

objXMLNews.load("http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world
/rss091.xml")

Dim xmlNodeNews
set xmlNodeNews = objXMLNews.documentElement.selectNodes("//item")

Dim xmlNewsItem

dim strResult

For Each xmlNewsItem In xmlNodeNews
strResult = "<a href='" & xmlNewsItem.selectSingleNode("link").Text & "'>"
strResult = strResult &
xmlNewsItem.selectSingleNode("title").Text
strResult = strResult & "</a><br/>"
WScript.Echo(strResult)
Next
--
Kirk Allen Evans
Microsoft MVP, XmlInsider, AspInsider
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans

"Rajiv Das" <ra********************@msn.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

Hi,
I am trying to incorporate Really Simple Syndicate (RSS) news into my asp
(not asp.net) based website. Since RSS is basically XML, I am trying to open the xml file and parse it. On Asp.net the following code works seamlessly. I am running IIS 5.1 on Win Xp Sp1.

-------------------------------------------------------------------------- -- Dim objXMLNews
set objXMLNews = Server.CreateObject("Msxml2.DomDocument.4.0")
objXMLNews.async = False

objXMLNews.load("http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world /rss091.xml")

Dim xmlNodeNews
set xmlNodeNews = objXMLNews.documentElement.selectNodes("//item")

Dim xmlNewsItem

For Each xmlNewsItem In xmlNodeNews
Response.Write("<a href='" &
xmlNewsItem.childNodes.Item(2).Text() & "'>")
Response.Write(xmlNewsItem.childNodes.Item(0).Text ())
Response.Write("</a><br/>")
Next
-------------------------------------------------------------------------- --
However on ASP I get the following error.

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: '[object]'

in this line -> [set xmlNodeNews =
objXMLNews.documentElement.selectNodes("//item")]

Any ideas?

--
----------------
Cheers,
Rajiv Das

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ayende Rahien | last post by:
I've the following code, taken from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml02172003.asp to select a node from RSS file. However, I'm always getting a null...
2
by: Ayende Rahien | last post by:
I've the following code, taken from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml02172003.asp to select a node from RSS file. However, I'm always getting a null...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
1
by: jcsnippets.atspace.com | last post by:
Hi everyone, I'm trying to read an xml config file in C#. To do this, I have used the xsd.exe tool to create an xsd file from my xml, and to generate code to read this xml file. Here is a...
7
by: satishr23 | last post by:
Hi, I am using AJAX to display dynamic RSS feeds in my web page. So on page load i am callin the AJAX function Start_Timer() The body of Start_Timer() is as follows. function Start_Timer() { ...
4
by: Tony | last post by:
Hello! Below I have a complete working program.with some simple classes one of these is a generic class. The question is about this method GetCows() {...} which is a member in the generic...
8
by: Greg C. | last post by:
I tried tackling this problem about 6 months ago, but after going almost completely insane I gave up, since my news feed seemed to display just fine anyways. However, in an effort to have my feeds...
4
by: Blake Garner | last post by:
I'm looking for suggestions on how to approach generating rss feed ..xml files using python. What modules to people recommend I start with? Thanks! Blake
2
jamwil
by: jamwil | last post by:
What's up guys. I'm having some issues... I've created a method as part of my lifestreaming class which takes an rss feed, and puts the data into a database... It's fairly simple... Check...
4
by: newzdog | last post by:
Hi, I have a problem parsing an rss feed using simplexml_load_file - this is strange as i have used the same code to parse literally 1000s of different rss feeds in the past, and even stranger in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.