XML in an .ahsx file

L

Lloyd Dupont

I'm using a newsgroup/blog/mailing list/forums all in one provider.
After some negociation they would let me display the web interface of my
newsgroup with a special template.

This special tempalet could be provided as a dynamic XML file.

I'm thinking of using a ".ashx" to generate it, is it a good choice?
Anyway .ashx begine with a 'context.Response.ContentType = "my xml mime
type"'
so.. whatis the XML mimetype?
I'm thinking of using "text/xml" what do you think of that?
 
A

Andrew Robinson

I think using an ASHX file works well:

context.Response.ClearContent();

context.Response.ContentType = "application/rss+xml";

XmlTextWriter xmlTextWriter = new
XmlTextWriter(context.Response.OutputStream, System.Text.Encoding.UTF8);

xmlTextWriter.Formatting = Formatting.Indented;

xmlTextWriter.WriteStartDocument();

xmlTextWriter.WriteComment("Generated with my xml / rss writer v1.0b");

xmlTextWriter.WriteStartElement("rss");

xmlTextWriter.WriteAttributeString("version", "2.0");

{

xmlTextWriter.WriteStartElement("channel");

{

xmlTextWriter.WriteStartElement("title");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top