How to make a blog with an XML feed?

Discussion in 'ASP .Net' started by Bruce W..1, Dec 2, 2003.

  1. Bruce W..1

    Bruce W..1 Guest

    Blogs are pretty basic. Yet many of them have an XML feed so they can be
    aggregated, and I've been trying to figure out the best way to do this.

    Of course one way would be to put your blog writings in a SQL database,
    but this seems like overkill. And there are programs sold that do
    everything a blog could want. However I want to whip one up with

    In what form should the blog writings be kept? And how can they be
    easily changed on a daily basis?

    After searching with Google I can't find any examples on how to create a
    blog using ASP.NET that has an XML feed. Any suggestions are

    Thanks for your help.
    Bruce W..1, Dec 2, 2003
    1. Advertisements

  2. Bruce Johnson, Dec 2, 2003
    1. Advertisements

  3. Bruce W..1

    Bruce W..1 Guest


    Thanks. It seems to have too much actually. I'm not trying to run a
    thousand blogs, just one.

    I'd like to keep a database out of this. So that means text or XML
    files of some sort. But I can't think of a good way to remotely edit
    these files. I could always FTP a new one but that doesn't excite me.
    Bruce W..1, Dec 3, 2003
  4. The way I did this was to use Xml Serialization to store the individual blog
    posts as xml files.

    The BlogPost type was the basic object. members were something like:
    string - header or "subject"
    string - body content. this was just plain text.
    DateTime - date posted
    optional list of updates, changes or comments.

    The object exposed a "save" method that used Xml Serialization to save
    itself as a file, with a name derived from the date of the post. It also
    exposed a constructor that accepted a date (and time); this method would
    slurp in (deserialize) the BlogPost from the XML file with the matching
    name. It had a default (no arg) constructor that would create a new blank
    post and initialize the date.

    To building an HTML layout from the various posts, I had an HTML template
    (or skeleton). Within that template was a "BlogPosts.ascx" control, which
    iterated over each post and did an XSL transform on the XML files to
    generate the HTML.

    To produce an XML output, it's much simpler - just instantiate the array of
    BlogPosts, the serialize each into Response.Out.

    Including markup in the blogpost body content is a bit more complicated.

    Dino Chiesa [Microsoft], Dec 3, 2003
  5. Bruce W..1

    Bruce W..1 Guest


    That's more along the lines of what I was thinking. What did you use to
    write new blog posts, just a textbox?

    I could have a subdirectory for each blog topic, into which the
    serialized XML files go. A read of this subdirectory directory could
    create a nav between the topics.
    Bruce W..1, Dec 3, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.