RSS Data Source Creation

Source: Internet
Author: User

Public class rss
{
Public string title;
Public string image_title;
Public string image_link;
Public string image_url;
Public string description;
Public string link;
Public string language;
Public string generator;
Public string ttl;
Public string copyright;
Public string pubdate;
Public string category;

Public rss ()
{}
Public rss (string stitle, string simage_title, string simage_link, string simage_url, string sdescription,
String slink, string slanguage, string sgenerator, string sttl, string scopyright, string spubdate, string scategory)
{
Title = stitle;
Image_title = simage_title;
Image_link = simage_link;
Image_url = simage_url;
Description = sdescription;
Link = slink;
Language = slanguage;
Generator = sgenerator;
Ttl = sttl;
Copyright = scopyright;
Pubdate = spubdate;
Category = scategory;
}
Public void create_xml (string filename, DataSet ds, string http)
{
XmlDocument doc = new XmlDocument (); // Add a header Node

XmlDeclaration delinoleic = doc. CreateXmlDeclaration ("1.0", "UTF-8", "no ");
Doc. AppendChild (decia );

XmlElement stitle = doc. CreateElement ("title ");
Stitle. InnerText = title;
XmlElement simage_title = doc. CreateElement ("title ");
Simage_title.InnerText = image_title;
XmlElement simage_link = doc. CreateElement ("link ");
Simage_link.InnerText = image_link;
XmlElement simage_url = doc. CreateElement ("url ");
Simage_url.InnerText = image_url;

XmlElement sdescription = doc. CreateElement ("description ");
Sdescription. InnerText = description;
XmlElement slink = doc. CreateElement ("link ");
Slink. InnerText = link;
XmlElement slanguage = doc. CreateElement ("language ");
Slanguage. InnerText = language;
XmlElement sgenerator = doc. CreateElement ("generator ");
Sgenerator. InnerText = generator;

XmlElement sttl = doc. CreateElement ("ttl ");
Sttl. InnerText = ttl;
XmlElement scopyright = doc. CreateElement ("copyright ");
Scopyright. InnerText = copyright;
XmlElement spubdate = doc. CreateElement ("pubdate ");
Spubdate. InnerText = pubdate;
XmlElement scategory = doc. CreateElement ("category ");


XmlElement image = doc. CreateElement ("image ");

XmlElement rss = doc. CreateElement ("rss ");
Doc. AppendChild (rss );
XmlAttribute version = doc. CreateAttribute ("version ");
Version. Value = "2.0 ";

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.