Why You Should Care About XSL

I'm often asked, "Why should I care about XSL when I already know how to do things using PHP or ASP or ColdFusion?"

As a programmer, I am all about efficient and easy to maintain code. As a person that hates to re-invent the wheel, I'm all about writing modular code. XSL helps me do both. I could go on and on about why XSL just makes sense as a templating language, but here are a few reasons on why you should care about XSL:

  • True separation of content and design – Content is stored in open-standard XML files and transformed with the appropriate output styling through XSL templates. Site redesigns do not require any changes to your content files.
  • Multi-file output – A single piece of content can be output into multiple designs or formats (e.g., desktop web, mobile, PDF, text only).
  • Supports all major server-side scripting languages – Because XSL is a transformation language, content is taken from its XML container and output in any format (e.g., HTML/XHTML/HTML5, PHP, ColdFusion, ASP, .NET). This is especially important in higher education, where schools often utilize different technologies across a single campus.
  • Non-rigid/non-proprietary document structure – You can use the XML structure that defines your content best. This also means that your content is not locked into a proprietary format.
  • Modularized and nested templates – XSL allows developers to maintain modular and extremely granular template control. Want to make every external link open in a new tab? Just import 3 lines of code.
  • Specification is defined/maintained by the W3C – XSL Transformations have official W3C recommendation for use as a templating language.

These are just a few of the reasons why I think you should care about XSL. Have any of your own? Let's discuss!