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(); //添加頭部節點
XmlDeclaration decla = doc.CreateXmlDeclaration("1.0", "utf-8", "no");
doc.AppendChild(decla);
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";