我做了一个RSS的聚合,在IE下面效果很好,可是在FireFox下面就出现了This XML file does not appear to have any style information associated with it. The document tree is shown below.以传统的XML形式出现。我在网上查了,看了别人的RSS,他们的下面都有
一个文件subscribe.js,好像是google开发了一个javascript代码。我是看别人网站生成的HTML后,保存分析,发现的。还有二个css文件。可
是我就是不知道怎么使用,请哪位高手指点一二,谢谢。如果可以请贴个代码。谢谢!谢谢!我的程序在IE下面和一般网站上的RSS效果一直,一到
FireFox下面就不行了!
代码如下:
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "text/xml";
Response.Write(GetRSS());
}
public string GetRSS()
{
DataSet ds = getDateSet();
StringBuilder strCode = new StringBuilder();
strCode.Append("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>");
strCode.Append("<rss version='2.0' xmlns:dc=\"
http://purl.org/dc/elements/1.1/\"");
strCode.Append(" xmlns:trackback=\"
http://madskills.com/public/xml/rss/module/trackback/\" ");
strCode.Append(" xmlns:wfw=\"
http://wellformedweb.org/CommentAPI/\"
xmlns:slash=\"
http://purl.org/rss/1.0/modules/slash/\">");
strCode.Append("<channel>");
strCode.Append("<title>Viewing Feed</title>");
strCode.Append("<link>index.aspx</link> ");
strCode.Append("<description>Latest Four Organization</description> ");
strCode.Append("<copyright>Copyright 2007</copyright> ");
foreach (DataRow row in ds.Tables[0].Rows)
{
string Id = row["organization_id"].ToString();
string title = Server.HtmlEncode(row["organization_name"].ToString());
string pmt = row["organization_payment"].ToString();
string pubdate = row["CreateDate"].ToString();
string ClassId = row["organization_id"].ToString();
string organization_full_address = row["organization_full_address"].ToString();
string organization_city_name = row["organization_city_name"].ToString();
string organization_state_code = row["organization_state_code"].ToString();
string organization_zip_code = row["organization_zip_code"].ToString();
string link = Server.HtmlEncode("transform_page.aspx?oid=" + Id + "&pmt=" + pmt);
string description;
if (organization_full_address != "" && organization_full_address != null)
description = organization_full_address + ", " + organization_city_name + ", " + organization_state_code + ",
" + organization_zip_code;
else
description = organization_city_name + ", " + organization_state_code + ", " + organization_zip_code;
strCode.Append("<item>");
strCode.Append("<title>" + title + "</title>");
strCode.Append("<link>" + link + "</link>");
strCode.Append("<subject>" + description + "</subject>");
strCode.Append("<description><![CDATA[" + description + "]]></description>");
strCode.Append("<PubDate>" + pubdate + "</PubDate>");
strCode.Append("</item>");
}
strCode.Append("</channel>");
strCode.Append("</rss>");
return strCode.ToString();
}