Use ASP + Access to create a website RSS-formatted content abstract

Source: Internet
Author: User
RSS is a lightweight, multi-purpose, scalable metadata description and joint promotion format. It can also be understood as a standard. It is an XML format used to provide selective and summarized Web content for the content integration client. Today, many sites have begun to provide content integration services to viewers by creating RSS feeds, and provide news and site content updates. Visitors can easily obtain the organization and summary information through some client software.
So how can we create an RSS feed on our own website? The following uses Asp + Access as an example.
Since RSS is a document in XML format, we should be able to filter and organize the data in the background database according to the conditions, and then generate a data stream in XML format through ASP, finally, it is sent to the client for browsing.
The selection and collection of data is a masterpiece of Asp. The key lies in how to generate data streams in XML format. In fact, Asp has its own solution, that is, to define the ContentType attribute of the response object before writing data. If the value of response. ContentType is "text/xml", an XML data stream is sent to the browser.
The method for calling the RSS source in the IE browser is no different from that for common links. The format is:
<A type = "application/rss + xml" href = "RssFeed. asp"> RSS description </a>
Type = "application/rss + xml" does not seem to have any difference when adding "no.
The following program section is the source code for creating the RSS feed for the "technical news" section on my website "100,000 why" (http://www.why100000.com/), named RssFeed_news.asp.
The variable sXmlClear is used to declare that the generated document is a document in XML format. This declaration is optional to maintain backward compatibility with the old XML version.
     
SRssHead defines the basic elements of Rss. RSS feed consists of four main elements: <channel>, & l t; image>, <item>, and <textinput>. The <channel> element is required, and the <item> element must appear at least once. The <textinput> and <image> elements are optional. Whether to use them depends on the actual situation.
<Channel> The element contains a brief description of the Channel (the source of the RSS feed. <Title> is the channel name/title. <link> is the URL of the webpage corresponding to the channel content that contains the complete content; <description> is a simple description related to the content of <channel>. <language> indicates a language. There are some other attributes, which are not too common.
<Item> The element is used to describe the records in the database. <Item> Generally, there are several items that correspond to the data set of an Rss feed.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.