Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > asp and rss feeds

Reply
Thread Tools

asp and rss feeds

 
 
Kez Bates
Guest
Posts: n/a
 
      07-30-2003
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>





 
Reply With Quote
 
 
 
 
Andrew Durstewitz
Guest
Posts: n/a
 
      07-30-2003
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.
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      07-30-2003
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

Kez Bates wrote:
> 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>






 
Reply With Quote
 
Kez Bates
Guest
Posts: n/a
 
      07-31-2003
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

"Bob Barrows" <> wrote in message
news:...
> What do you mean by "does not appear to work"?
>
> If I brought you my toaster and asked you to fix it, what would be your
> first question to me?
>
> Bob Barrows
>
> Kez Bates wrote:
> > 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>

>
>
>



 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      07-31-2003
Kez Bates wrote:
> 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

> Hope you can shed some light for me.
>
> Thanks Kez
>
> "Bob Barrows" <> wrote in message
> news:...
>> What do you mean by "does not appear to work"?
>>
>> If I brought you my toaster and asked you to fix it, what would be
>> your first question to me?
>>
>> Bob Barrows
>>
>> Kez Bates wrote:
>>> 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>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two ways to generate RSS - rss/maker and rss/2.0 - which is better? Jonathan Groll Ruby 1 06-27-2009 03:53 AM
ASP.NET and RSS Weather Feeds Craig M ASP .Net 2 02-05-2008 02:37 PM
Problems with Norwegian letters when integrating RSS feeds in webpage using ASP nostradamus@laboremus.no ASP General 1 09-20-2006 03:01 PM
How to display "No Rss feeds new availabe" when there are no FEEDS Patrick Olurotimi Ige ASP .Net 2 05-04-2005 11:50 PM
Searches in multiple RSS feeds -> new rss feed Motta XML 1 06-09-2004 10:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57