Recently I’ve been building a website using Cocoon 2.1.9, a Java based publishing framework. I chose this platform largely for the experience with Java and, in a few weeks time, native XML databases.
I’ve worked with XML before, often in the form of RSS, and have found this way of structuring documents fairly logical. But what about using XML and associated technologies to build an entire website?
This brief really brought home the importance of getting the initial document structure right. Establishing the appropriate schema is as important for XML documents as it is in RDBMSs, after all it determines the flexibility of your data storage and can’t easily be redesigned. I’m hoping that all the time I’ve spent will pay dividends as the web application grows.
It also highlighted those things that XML and RDBMS do best.
Take a document like this one, it’s a hierarchically ordered plain text file which is perfectly suited to XML. In fact if you make it more complex, like a book with chapters for example, it becomes even better suited to XML and harder to implement in a RDBMS. I think, though I must confess I’ve never fully understood, that this is what they refer to as docu-centric data.
Now take a load of bird sighting data; totally different project; that relates species to locations to dates to weather conditions to… well you get the idea. These are complex many-to-many relationships and this is where RDBMS shine. Coupled to fact that most RDBMS have considerable power for processing complex search queries and they’re the platform of choice for this type of work.
RDBMS are already heavily used on the Web, but in my opinion, increasing amounts of docu-centric data is going to be made available on the Web and LANs in XML format. Most office applications already support this and many use file formats that are natively XML. Interoperability is going to depend on communicating in XML and the possibilities this presents for new platforms and services is exciting to me… errr just pretend I didn’t say that. Cocoon is interesting because it permits me to use any of these data sources and handle the whole lot as XML streams.
Which brings me to the presentation layer, where Cocoon is primarily focused. So far I’m impressed, the best part has been working with XML and XSL. It’s fantastic using XSLT stylesheet to creat the web page structure and CSS implement the graphic design. It is allowing me to handle documents and construct the website in much cleaner and more adaptable way than I’ve achieved with PHP.
In addition I can use XSLT stylesheets to manipulate well structured XML documents before passing the result to another for transformation into the final XHTML web page. All this currently takes place on my server, consuming system resources and some might say reducing scalability. The original goal of exploring this technology was for my websites to work natively in XML, whether they have a RDBMS back-end or not. In time I hope to be able to transfer much of the presentation layer processing load to the client using the browser client-side XSLT capability.
I’ve been experimenting with that too, and it’s impressive what can already be done, as long as you’re not afflicted with Microsoft Internet Explorer 6. Firefox 2, Opera 9 and Safari all work well with basic XML/XSLT and CSS. Web applications could assess the processing capabilities of the clients and send either XML/XSLT/CSS or XHTML/CSS, for example, for desktop or mobile platforms respectively. In addition for saving processing power the first option gives the client more flexibility in handling the data as we’ve already seen with RSS.
I’m going to finish my Cocoon website, enabling the option for client-side transformations. Then I’m going to design an XSL based Wordpress theme. That might seem a bit pointless since PHP can be viewed as a templating language itself, but as I’ve explained above XML is the future. But most of all I intend to enhance my skills with XML technologies, a step which I think will pay off soon.
There are no comment for this post at the moment. Please feel free to let me know what you think.
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.