The prospect of publishing your Web content from a database is tantalizing. As we saw last week, a well-orchestrated site allows you the ultimate in flexibility. Keeping your content inside a database in a stripped-down format is ideal. Your pages can be tweaked and updated at will, since content doesn't merge with the HTML formatting until it's time to publish. Then, by simply pushing your chunks of content through templates, you're left with the finished product after only minimal additional effort.
We also looked at two different strategies for using this sort of object-oriented publishing: One assembles the pages during the production process; the other puts them together on the server when users hit the page. But there's a third way of realizing this ideal of Web-site management, and you probably already have the software installed on your computer.
If you've upgraded your browser recently, you have the foundations of a content template system in place. All you have to do is translate some of the backend database concepts we've been talking about into the lingo of everyday browser technologies. Think of your big backend database as simple, structural HTML files and the templates as linked, cascading stylesheets. The less formatting you put into your HTML (things like tables used for layout, font tags, and the like), the easier it is to change later. For example, if every element on one of your HTML pages were referenced in a stylesheet and every page of your site were made up of the same basic elements, redesigning your site would be as easy as updating the stylesheet. That is, in essence, how the big content-management systems work - they just do the tricky stuff on the server rather than in the browser.
Simple, yes. But optimal, no. You see, with any content system, you define the elements of your pages by what they are. You specify in your content which bits of text are the headlines, subheads, bylines, and body content. Then, when you push it through a template, that information is stripped out and replaced with HTML formatting tags. You've effectively had to throw away all that valuable metadata.
The same holds true for our simple HTML/CSS system outlined above. Instead of the rich, meaningful information you'd like to include on your page (who wrote it, what the dateline is, etc.), you can only specify the most basic of meanings:
for headlines, *for things that are somehow "important." Wouldn't it be better if you could retain the true structure of your document, retain all the detailed information about the content on your page? You could put tags around the name of the person who wrote the story and a tag around that. That, my friends, is the utopian vision of XML, the eXtensible markup language. And that is the future of publishing on the Web.