WebXml : Object-oriented Web Page Processor

WebXml is an XML-based, object-oriented web processing system that was developed internally by Timpani Software. You are experiencing a live demonstration of WebXml right now - this web site is powered by it.

History & Project Motivation

The development of WebXml highlights a classic challenge in the technology arena today. Namely, how do you find, acquire, learn, and adopt a technology that will solve a specific business problem? How much time should you spend looking for an existing technology before attempting to develop it internally?

That was the dilemma we faced when we decided to develop WebXml. There are obviously many technologies available to contruct web sites. The choices range from free and simple server-side tag processors such as ASP, ASP.NET, JSP, PHP, etc., to open source community portal servers such as Mambo, DotNetNuke, and PHPNuke, to complex and expensive commercially-available web content management systems.

While some of the technologies we looked at came close to meeting our desired feature set, none of them matched all of our selection criteria, which included object-oriented templated design, full and precise control over the final HTML output, clean URLs, ease of use, learnability, and affordability.

When WebXml is used in conjunction with a version control system (we use the open source Subversion system for our web site), it makes for a simple and effective web content management system.

Project Goals

We wanted a system that would support the following workflow:

  • Separate the content, design, and business logic, allow each to be modified independently of the other.
  • Minimize the amount of code that must be managed in code-behind pages.
  • Make it easy to add new content pages to the web site.
  • Allow a complete redesign of the website look-and-feel to be done at the same time new content pages are being added to the old web site. When the redesign is done, new content pages that were done while the redesign was in process should appear under the new look-and-feel.
  • Allow iterative changes to the website design to be done easily, without having to make large, similar changes in many places.
  • Embrace sound software engineering principles, especially object-oriented design. Specifically, we wanted inheritance features - pages derive from other pages, and polymorphism - derived pages can override certain sections of their parent's content, and inherit the rest.

Similarities to ASP.NET 2.0

It turned out that ASP.NET 2.0, with its master pages and content placeholder controls came tantalizingly close to what we were after, but still did not give us the flexibility, control, and precision that we were looking for.

One issue that we have with ASP.NET is that it is hopelessly tied to files located on the file system, in specific locations (underneath the root directory for the web site). What if the .aspx content isn't located in a physical file on the hard drive? Suppose it is stored in a database, or embedded within a larger XML file. Or suppose you want to dynamically construct the .aspx content by assembling different snippets of content together.

For all the power of the .NET Framework, there is no exposed method that we could find that will convert a string containing .aspx content into HTML output.

By writing our own processor, we created an extra level of indirection that allows us to hook and extend functionality in a way that would have been difficult or impossible to do with straight ASP.NET. In fact, WebXml is written using ASP.NET, but it uses lower-level ASP.NET hooks (we capture all URL requests into our own HttpHandler) that replaces .aspx files. Instead of using .aspx as input files, WebXml reads content from a series of XML files.

WebXml also has the ability to revert back to .aspx-driven content, giving us the best of both worlds. We had to perform some trickery to implement this. As noted above, .NET does not expose any method that will convert a string containing .aspx content into HTML. Therefore, we implemented this functionality by writing the string to a temporary file, using some low-level ASP.NET trickery (involving the SimpleWorkerRequest class) to perform the processing, then deleting the temporary file. It's not ideal, but it works. Hopefully, one of our readers will find a way to do this without temporary files and tell us about it.

Availability

We'll be posting more details on WebXml in the future. It is not available for sale, but we do use it on professional service engagements when and where it makes sense. We are considering turning it into an open source project. If you'd like to learn more, drop us an e-mail and tell us what you think.

Back to Timpani Software Labs