January 11th, 2002, 06:47 AM
XML-based content management system/"weblog": a newbie's project idea
I've run into a problem now, working on my personal website, featuring years' worth of writing on various topics. It's been down for a while now, while I've been thinking of where to go next, and I've been trying to learn ways to do that, but I'm just not doing well. Since I've started learning about XML, though, I've been given hope.
The language's theory makes a lot of sense to me, and I'm really excited about working with it. But due to a odd lack of resources on the web, I'm not sure I fully understand all of its applications. For that reason, my idea here could be totally stupid. I'm speculating about what it can do for me -- and that's help me build a beautiful, dynamic, easy-to-update and easy-to-maintain content-driven website, and allow me to keep all of my old articles in a good format for the future.
I want to build a simple content management system with XML, XSLT, and PHP. The website should end up with a weblog-type short article format on the front page, with an archive of its older material available to the side, and an array of supporting information -- basic information and still older articles, at this point. There's no photography or other multimedia, and I don't intend to include any in the future.
The articles and other stuff stored in the XML files will be inserted into a simple template system -- one template for the "weblog" page, one template for the article pages, etc. I'm a big fan of sparse, minimalist design, and I do all of my work in strict XHTML. (If I decided I wanted to go with some obnoxious, brightly-colored Flash monstrosity, though, I'd only be editing those two or three HTML templates and my two or three XSLT files. Fabulous!)
This CMS sounds like it should be fairly simple to build, at least for the older, static archive pages. My articles are stored in XML files, and their presentation is controlled with XSLT. When a client requests one, PHP does its work. My web host has Sablotron, so I don't forsee any problems with parsing.
I'm not quite sure how I'd build an actual database-like "weblog" system, though. I'd want some sort of admin page, where I could enter articles without FTPing files and editing them (I see PHP writing to the XML files here). Those articles would be separated into categories, and visitors could view each one separately. I'd want my front page to show the last certain number of articles, and I'd want anything that scrolled off that page collected in an archive-like section.
In a perfect world, I'd also be able to include a comment system with user registration, so people could comment on my stories and I could ban them if I felt like it. I'd also have some sort of search function, because I like to make Jakob Nielsen happy. Neither of those are necessary, though, and I understand they put me into more contact with PHP.
I know this CMS is something that'd be fairly easy in PHP and mySQL. But here's why I want to try it in XML instead:
- I want my data -- my writings and supporting information about them -- to be as portable and extensible as possible. If I have an XML file with a year's worth of articles, I think it'd be more useful than an SQL dump text file, full of SQL command junk. I'm tired of copying and pasting my old text files into new HTML files every time I redesign. I want a real archive of my work I can carry around with me, one I can read with a text editor, not a big database application.
- I really want to build the CMS myself, because I like knowing how things work and I want to learn something. PHP has been difficult for me to understand, but XML's making all sorts of sense.
So, my questions to you are:
- Is this possible, or would it be so hard to implement that my newbie, albeit eager and quick-learning, *** wouldn't have a chance? How about a stripped down version?
- Have you ever seen any systems like this at work on small sites? Do you have a link?
I'm always looking for more resources, too. I'm especially interested in articles about real-world XML applications by real-world people -- I'd like to hear the stories of low-budget small business owners and small-time developers investing heavily in XML, not the ones of high-budget corporations' IT departments. The XML web community's sorely lacking for the scarceness of those sorts of articles.
Thanks a lot, and I'm really looking forward to feedback.
January 11th, 2002, 09:26 AM
Using PHP+XML, it isn't that hard to implement. I think you should just try and start. Read some XML articles, at Devshed or anywhere else you can find them. Try to build the engine first, don't start building the XSL yet, you can implement that later using the great tutorial from xfront.
No, not yet. I have my own forum, not public, which is based on XML/XSL and I'm currently working on a Java site using PHP+XML+XSL with some other people. This will launch somewhere in march, but I can't show you anything yet.
I don't have any more time now, but I'll add some more comments later.
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs
January 11th, 2002, 10:25 AM