Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2003, 03:39 PM
Registered User
 
Join Date: Nov 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble reading RDF

Is there anyone that can help my with the following problem:

I have got a lot of help from Rajiv Das to create an asp news grabber by
using Msxml2.ServerXMLHTTP.4.0
The code works fine when I grab headers from RSS 0.91 +
But when I add URL from RDF sites the code reports an error

Microsoft VBScript runtime error '800a01a8'
Object required: '[object]'
/grab.asp, line 68

The line 68 have look like this:
response.write "<a href='" & objNodeList2.Item(2).text & "'>"

Is there anyone that can see what's wrong in the code bellow? What shall I
do to get this code also to work with RDF feeds?

<h3>BBC Top News</h3>

    <%
    Dim srvXmlHttp
    Dim URL
    Dim newsElement
    Dim objNodeList1
    Dim objNodeList2
    Dim i

    set srvXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
    URL =
"http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/world/rss091.xml"
    srvXmlHttp.open "GET", URL, false
    srvXmlHttp.send
    newsElement = srvXmlHttp.responsexml.text

    if (Cint(srvXmlHttp.status) = 200) then
         set objNodeList1 =
srvXmlHttp.responseXML.getElementsByTagName("title ")
         set objNodeList2 =
srvXmlHttp.responseXML.getElementsByTagName("link" )
         response.write "[list]"
          response.write "<li>" & vblf
   response.write "<a href='" & objNodeList2.Item(2).text & "'>"
   response.write (objNodeList1.Item(2).text)
   response.write "</a>"& vblf
   response.write "</li>"& vblf

         response.write "</ul>"
    end if
    %>

<h3>Yahoo Top News</h3>
<%
    URL = "http://rss.news.yahoo.com/rss/topstories"
    srvXmlHttp.open "GET", URL, false
    srvXmlHttp.send
    newsElement = srvXmlHttp.responsexml.xml
    if (Cint(srvXmlHttp.status) = 200) then
         set objNodeList1 =
srvXmlHttp.responseXML.getElementsByTagName("title ")
         set objNodeList2 =
srvXmlHttp.responseXML.getElementsByTagName("link" )
         response.write "[list]"
          response.write "<li>" & vblf
   response.write "<a href='" & objNodeList2.Item(2).text & "'>"
   response.write (objNodeList1.Item(2).text)
   response.write "</a>"& vblf
   response.write "</li>"& vblf

         response.write "</ul>"
end if
%>

<h3>Freshmeat</h3>
<%

   ' This URL give an error
    URL = "http://freshmeat.net/backend/fm.rdf"
    srvXmlHttp.open "GET", URL, false
    srvXmlHttp.send
    newsElement = srvXmlHttp.responsexml.xml
    if (Cint(srvXmlHttp.status) = 200) then
         set objNodeList1 =
srvXmlHttp.responseXML.getElementsByTagName("title ")
         set objNodeList2 =
srvXmlHttp.responseXML.getElementsByTagName("link" )

         'Open this to check the requset

         'response.write srvXmlHttp.status
         'response.write srvXmlHttp.responsexml.xml

         response.write "[list]"
         response.write "<li>" & vblf
         response.write "<a href='" & objNodeList2.Item(2).text & "'>"
         response.write (objNodeList1.Item(2).text)
         response.write "</a>"& vblf
         response.write "</li>"& vblf
         response.write "</ul>"
end if
%>


Regards
Einar Hansen, Norway




Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert XML to RDF deean XSLT 18 May 7th, 2013 03:31 AM
The advantage of XML rather than RDF deean XML 2 June 17th, 2008 01:20 PM
Appending child nodes to a RDF/OWL file using xslt sesath XSLT 2 May 10th, 2007 04:37 AM
If Else Trouble Cibressus Beginning PHP 0 May 1st, 2007 02:04 PM
RDF, OWL and XSL-FO NEO1976 XSLT 6 August 23rd, 2006 04:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.