How to make a blog with an XML feed?

B

Bruce W..1

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
ASP.NET.

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
appreciated.

Thanks for your help.
 
B

Bruce W..1

Bruce said:
Take a look at the .Text project in the Workspaces
section of GetDotNet (http://www.gotdotnet.com). It is a
blog that has been developed using the .NET Framework and
it probably already has the stuff that you're looking for.

Bruce Johnson
http://www.objectsharp.com/Bruce
================================================

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.
 
D

Dino Chiesa [Microsoft]

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.

-D
 
B

Bruce W..1

Dino Chiesa said:
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.

-D
=======================================================

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.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top