The Eternal Debate: Velocity or XSLT
Wednesday, August 31st, 2011 at 4:00pm -- Rahul BhagnariWith the recent release of Cascade Server 6.10, we have added enhanced Velocity tools designed to make writing formats even easier and to provide maximum flexibility to our users. Check out some of the newly integrated tools: Display Tool, Escape Tool, Math Tool and Number Tool, among others. We have found that Velocity’s similarities to PHP and JavaScript mean that it takes less than 30% of the time to create a format in Velocity as it does to create a traditional XSLT format. Plus, Velocity is easier to learn, easier to read, and easier to debug than XSLT. So, with all benefits of Velocity and the advances in its integration with Cascade CMS, we must address a frequently asked question—Velocity or XSLT?
In the Cascade CMS stadium, which format reigns supreme? Let me go ahead and tell you the end first: Either one can do the job and do it well! Honestly. But there are some genuine benefits of each, which is why we are proud to support both.
Let’s look at a few important categories to compare Velocity and XSLT:
- ROBUSTNESS:
- Velocity works without the Xalan JavaScript extensions for date functionality, such as start dates and end dates.
- XSLT stylesheets can be included within other XSLT stylesheets, including the ability to cross-Site share these formats.
- XSLT formats can be tested and created outside of Cascade Server.
- INCLUSIVENESS:
- The Velocity engine continues to be updated with new tools cropping up all the time, which we incorporate into new versions of Cascade CMS as appropriate. Be sure to make any requests on our idea exchange.
- XSLT was designed specifically to go through XML data and therefore it’s often a foolproof method when displaying your content.
- Including PHP and JavaScript code snippets in your Velocity stylesheet is as easy as reading this sentence!
- GENERAL EASE:
- XSLT is an XML document and is designed to read XML data (exclusively) making it simple for clients to map their transformation from the XML content to how it should be output on the page.
- Velocity is often coded in a straightforward, linear way making it easier and clearer to “see” and understand your format. Despite the standardization of XSLT, it’s still pretty hard to troubleshoot and debug.
- Velocity looks startlingly similar to JavaScript and therefore isn’t much of a jump in logic for many people; this makes it much easier to learn.
Hannon Hill has pulled out all the stops in supporting Velocity because we think it offers superior benefits to our users over XSLT. Additionally, Velocity allows us to develop our own tools based on your needs. While we support traditional XSLT, we chose to support Velocity as well in order to provide a more intuitive, easy-to-learn-read-debug, and more efficient format. More tools and other types of transformations are already in the pipeline! If you have any requests, please contact us at support@hannonhill.com or make your suggestions known on our help forums.
In conclusion, there really is no battle between Velocity and XSLT at all because we want you to determine what works best for you and feel free to use both—even on the same page! We do and will continue to support both Velocity and XSLT so you have maximum flexibility within Cascade CMS.
For more in-depth information, check out our 2010 User Conference Presentation on the topic featuring engineering all-star Brent Arrington. Check out the example.com and example.edu Sites to see various XSLT and Velocity examples. Some of these formats are also located at GitHub, our main repository for various examples, tools and code.
Category
- Resources
- Product Upgrades