Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2003
    Location
    United Kingdom
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with RSS in ASP Please

    Hi. I have a problem which i think is quite odd. I have built an XML file for an RSS feed, and everything is working great.

    However, i have a need to build the XML data dynamically. I therefore saved my XML file as an ASP page and built a little script that created the item nodes. This failed. To cut a long story short, the problem is not with the ASP code, but with the fact that the page is an ASP page.

    If you take a look at the code at the bottom of this post (Shamelessly stolen from the BBC website for testing), you will see there is no ASP in it. In fact, if it is saved with an .xml extension, all is good.

    However, save the file with an .asp extension and the page doesn't even open in my web browser. It just hangs and after about 5 minutes, crashes. I have pinpointed where the problem is. it is the "greater than" character at the beginning of <channel>. Remove that and the page opens - albeit incomplete.

    I have the same problem in Internet Explorer (all versions), Netscape Navigator version 8 and Opera. It also happens on three of my collegues PC's, indicating it is not my PC that is at fault, but the actual file

    Can anyone explain?
    Code:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/shared/bsp/xsl/rss/nolsol.xsl"?>
    <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
      <channel>
        <title>BBC News | News Front Page | UK Edition</title>
        <link>http://news.bbc.co.uk/go/rss/-/1/hi/default.stm</link>
        <description>Visit BBC News for up-to-the-minute news, breaking news, video, audio and feature stories. BBC News provides trusted World and UK news as well as local and regional perspectives. Also entertainment, business, science, technology and health news.</description>
        <language>en-gb</language>
        <lastBuildDate>Mon, 29 Jan 2007 12:07:41 GMT</lastBuildDate>
        <copyright>Copyright: (C) British Broadcasting Corporation, see http://news.bbc.co.uk/1/hi/help/rss/4498287.stm for terms and conditions of reuse</copyright>
        <docs>http://www.bbc.co.uk/syndication/</docs>
        <ttl>15</ttl>
        <image>
          <title>BBC News</title>
          <url>http://news.bbc.co.uk/nol/shared/img/bbc_news_120x60.gif</url>
          <link>http://news.bbc.co.uk/go/rss/-/1/hi/default.stm</link>
        </image>
        
        <item>
          <title>Ex-soldier admits killing family</title>
          <description>A former serviceman admits the manslaughter of four members of his family who were found shot dead.</description>
          <link>http://news.bbc.co.uk/go/rss/-/1/hi/england/tyne/6309169.stm</link>
          <guid isPermaLink="false">http://news.bbc.co.uk/1/hi/england/tyne/6309169.stm</guid>
          <pubDate>Mon, 29 Jan 2007 11:48:00 GMT</pubDate>
          <category>Tyne</category>
        </item>
      </channel>
    </rss>

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    I ran into this problem last year, i just used FSO and wrote the rss feed out to an .xml file.

    however, i know that there is a way to do it directly from an asp by specifing the contact type.

  • #3
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    ah i think this is it:

    PHP Code:
    Response.contenttype "text/xml" 
    just insert at the top of the page.

  • #4
    New Coder
    Join Date
    Mar 2003
    Location
    United Kingdom
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is it. Works like a charm. Thanks for your help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •