Hi
I have a small and easy program that write a RSS.
Althought the generation works perfect, IE tells me it's not valid.
I get crazy because :
-removing a space at the end of the generated XML seems to help
-It refuses to read more than 5 items in the RSS
there is something i miss there in the XML. It drives me crazy.
Thanks for any help or any link giving help to XML problems
Jonathan
MemoryStream ms = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(ms,
System.Text.Encoding.UTF8);
writer.Formatting = Formatting.Indented;
WriteRSSPrologue(writer);
SqlConnection Sqlconnection=new SqlConnection ("Data
Source=;Initial Catalog=L;User=;Password=");
SqlCommand cmd=new SqlCommand("select Top 5
articlenum,ArticleTitle,folderpath,teasertext from tblArticleList
where published='t'",Sqlconnection);
Sqlconnection.Open();
SqlDataReader dr=cmd.ExecuteReader();
while(dr.Read())
{
AddRSSItem(writer,dr.GetString (1),dr.GetString (2),dr.GetString
(3));
}
Sqlconnection.Close();
WriteRSSClosing(writer);
writer.Flush();
writer.Close();
Response.ContentEncoding = System.Text.Encoding.Unicode;
Response.ContentType = "text/xml";
Response.Cache.SetCacheability(HttpCacheability.Pu blic);
String FILENAME = Server.MapPath("La.xml");
StreamWriter objStreamWriter = File.AppendText(FILENAME);
//Response.Write (System.Text.Encoding.UTF8.GetString(ms.GetBuffer( )).TrimEnd());
objStreamWriter.Write(System.Text.Encoding.UTF8.Ge tString(ms.GetBuffer()).TrimEnd());
objStreamWriter.Close();
ms.Close();
}