XML in an .ahsx file

Discussion in 'ASP .Net' started by Lloyd Dupont, Dec 6, 2005.

  1. Lloyd Dupont

    Lloyd Dupont Guest

    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?
     
    Lloyd Dupont, Dec 6, 2005
    #1
    1. Advertisements

  2. 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");


    --

    Andrew Robinson
    www.binaryocean.com
    www.bellinghamdotnet.org


    "Lloyd Dupont" <net.galador@ld> wrote in message
    news:ORrglFr%...
    > 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?
    >
     
    Andrew Robinson, Dec 6, 2005
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leona
    Replies:
    9
    Views:
    2,495
    Henry S. Thompson
    Nov 1, 2004
  2. Robert S

    UPnP xml file to WSDL xml file

    Robert S, Oct 14, 2005, in forum: XML
    Replies:
    1
    Views:
    1,291
    Robert S
    Oct 14, 2005
  3. jkflens
    Replies:
    2
    Views:
    1,735
    jkflens
    May 30, 2006
  4. Johan
    Replies:
    20
    Views:
    1,951
    Arndt Jonasson
    Feb 27, 2007
  5. Poirot
    Replies:
    0
    Views:
    1,536
    Poirot
    May 11, 2011
  6. Eric van Oorschot

    Copy characterdata from XML file to XML file

    Eric van Oorschot, Dec 7, 2005, in forum: Perl Misc
    Replies:
    12
    Views:
    288
    robic0
    Dec 10, 2005
  7. Erik Wasser
    Replies:
    5
    Views:
    841
    Peter J. Holzer
    Mar 5, 2006
  8. Replies:
    5
    Views:
    352
    Chris Angelico
    May 14, 2014
Loading...