The XML SiteXML benefits, XSL benefits.

Benefits of XML and XSL for website authoring

XML processing Ok, so I believe that HTML is just not enough, but why use XML and XSL? Why not PHP or today's latest personal publishing tool? What are the advantages over other technologies? When should we use them and when shouldn't we?

Well, first of all, it doesn't have to be a choice. Certain techniques are appropriate for certain uses, and they often are complementary, with the possibility to be applied at the same time. That being said, XML and XSL/XSLT have certain advantages when writing a website.

Advantages

The XML family of technologies was created for this purpose: manipulating text. Its syntax and the set of support tools are perfectly suitable to do just that. They are coherent and work well together by design.

Performance

The web pages are statically generated and not dynamically, per each HTTP request. This allows web servers to serve them faster to the client.

The HTML page itself is the product of a transform and not the page on which the development is done. Because of that, it can be optimised for size instead of readability by eliminating white spaces and indentation. This allows for up to 50% smaller HTML pages, while the XML and XSL we edit is still nicely indented and spaced out, easy to read and change.

Separated content and code

The website content is kept in XML files. The code, structure and navigation information is kept in XSL templates. Adding new content to the web site means editing the XML files, while working on the structure and presentation means changing the XSL and CSS files.

They are both well defined, disconnected operations. They can be easily done by different people (content writers vs. web designer).

Text based

All content, code and style are stored in simple, human readable, plain text files which can be checked in source control systems. The editing can be done with a wide range of editors.

Flexibility

You can do anything, you have full control. Today's publishing tools are pretty powerful but their power often comes at the expense of customisability. XSL/XSLT lets you control every single aspect of your website's creation. There is no need to change weird templates, to learn a new syntax for each new tool. That's power.

Disadvantages

It does not address the dynamic website scenario. An application server type of framework has to be used in this case. But they can be used complementary. Adding PHP code into the generated HTML pages is trivial.

Read on: XML and XSL tools and documentation.

First Posted: September 3rd, 2005 - Saturday.
Last Updated: September 29th, 2005 - Thursday.