asp and rss feeds

K

Kez Bates

Hi there
I am trying to create a newsfeed on my website. I used the following code
on my website which I found somewhere. I then placed the call to this code
in my web document. It does not appear to work. Am I missing something???
Thanks Kez.

Function getXML(sourceFile)
dim styleFile
dim source, style
styleFile = Server.MapPath("news.xsl")

Dim xmlhttp
Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET", sourceFile, false
xmlhttp.Send

set source = Server.CreateObject("Microsoft.XMLDOM")
source.async = false
source.loadxml(xmlhttp.ResponseText)

set style = Server.CreateObject("Microsoft.XMLDOM")
style.async = false
style.load(styleFile)

getXML = source.transformNode(style)
set source = nothing
set style = nothing
End Function
%>
<html>
 
A

Andrew Durstewitz

Make sure the object is installed on the server. I have seen this
happen when the XMLHTTP object isn't installed it just does nothing.

hth,
Andrew
Hi there
I am trying to create a newsfeed on my website. I >used the following code
on my website which I found somewhere. I then >placed the call to this code
in my web document. It does not appear to work. Am >I missing something???
Thanks Kez.

Function getXML(sourceFile)
dim styleFile
dim source, style
styleFile = Server.MapPath("news.xsl")

Dim xmlhttp
Set xmlhttp = >Server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET", sourceFile, false
xmlhttp.Send

set source = >Server.CreateObject("Microsoft.XMLDOM")
source.async = false
source.loadxml(xmlhttp.ResponseText)

set style = >Server.CreateObject("Microsoft.XMLDOM")
style.async = false
style.load(styleFile)

getXML = source.transformNode(style)
set source = nothing
set style = nothing
End Function
%>
<html>

* * * Sent via DevBuilder http://www.devbuilder.org * * *
Developer Resources for High End Developers.
 
B

Bob Barrows

Oh, wait ... you're doing this on the server (duhhh!). You need to use the
ServerXMLHTTPRequest object, not the client-side XMLHTTPRequest object.

Bob Barrows
 
K

Kez Bates

Yes, I did realise that I hadn't put in my actual error, but I had already
submitted my question.

I am currently getting the following...
The stylesheet does not contain a document element. The stylesheet may be
empty, or it may not be a well-formed XML document.

Tried your serverside object and it comes up with
error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
Invalid ProgID.

Which microsofts solution to is, and I quote... "You can ignore this error
message. It will go away. "

Hope you can shed some light for me.

Thanks Kez
 
B

Bob Barrows

Kez said:
Yes, I did realise that I hadn't put in my actual error, but I had
already submitted my question.

I am currently getting the following...
The stylesheet does not contain a document element. The stylesheet
may be empty, or it may not be a well-formed XML document.

This sounds like a problem with the xsl document. You might try posting it
at microsoft.public.xsl. I'm not an xsl user.
Tried your serverside object and it comes up with
error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
Invalid ProgID.
Oops, I gave you the wrong name for the object: it should have been
ServerXMLHTTP. The correct instantiation is "MSXML2.ServerXMLHTTP"

Here is an example of its use: http://www.aspfaq.com/show.asp?id=2173
Which microsofts solution to is, and I quote... "You can ignore this
error message. It will go away. "

Can you tell me where this "solution" comes from?

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top