asp and rss feeds

Discussion in 'ASP General' started by Kez Bates, Jul 30, 2003.

  1. Kez Bates

    Kez Bates Guest

    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>
    Kez Bates, Jul 30, 2003
    #1
    1. Advertising

  2. 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.
    Andrew Durstewitz, Jul 30, 2003
    #2
    1. Advertising

  3. Kez Bates

    Bob Barrows Guest

    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>
    Bob Barrows, Jul 30, 2003
    #3
  4. Kez Bates

    Kez Bates Guest

    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>

    >
    >
    >
    Kez Bates, Jul 31, 2003
    #4
  5. Kez Bates

    Bob Barrows Guest

    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>
    Bob Barrows, Jul 31, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick Olurotimi Ige
    Replies:
    2
    Views:
    475
    Patrick Olurotimi Ige
    May 5, 2005
  2. Motta
    Replies:
    1
    Views:
    504
    Andy Dingley
    Jun 9, 2004
  3. Craig M

    ASP.NET and RSS Weather Feeds

    Craig M, Feb 5, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    2,136
    siccolo
    Feb 5, 2008
  4. Replies:
    1
    Views:
    108
    Martin Honnen
    Sep 20, 2006
  5. Jonathan Groll
    Replies:
    1
    Views:
    248
    Kouhei Sutou
    Jun 27, 2009
Loading...

Share This Page