XSLT in action – rather trivial tricks for XSLT that I always seem to forget

Lucas Jellema

Recently I dipped into XSLT somewhat more seriously than I had done for quite some time. For some reason, I find XSLT not so intuitive to me that all things I once knew are still at the tip of my fingers. Instead, I have to Google quite a lot for things that I assume are pretty trivial. In this post, I describe a number of the issues I ran into that were resolved rather smoothly by looking on the Internet and applying hints, suggestions and code fragments to my specific situation. The post is primarily for my own benefit: the next time I will work with XSLT after a period of low XSLT activity, I will know where to go.

W3Schools – Code Library

XSLT Libraries and Extensions

XSLT Standard Library The XSLT Standard Library, xsltsl, provides the XSLT developer with a set of XSLT templates for commonly used functions. These are implemented purely in XSLT, that is they do not use any extensions. The standard library is hosted on SourceForge. The functionality includes Date/Time processing, String processing and Math operations.
EXSLT EXSLT is a community initiative to provide extensions to XSLT. The extensions are broken down into a number of modules: Dates and Times, Dynamic, Common, Functions, Math, Random, Regular Expressions, Sets, Strings. Some extensions require specific XSLT engines, others are implemented in general languages such as JavaScript or (even more portable) as XSLT templates (like the XSLT Standard Library):

When it comes down to it, nothing beats a named template for portability. Named templates are pure XSLT 1.0. You don’t have to worry about which XSLT processor you’re using or what it supports to know that you can use named templates. Within EXSLT, we try to provide a named template with as near to the equivalent functionality of each extension function as you can get.

Next Post

SVG (Scalable Vector Graphics) and Maps of the World

Facebook0TwitterLinkedinI have some vague plans for presenting statistics using SVG and a World Map. I was thinking for example about the spread of the visitors of our Website across the countries and continents of the world. And also about a world map with time zones that displays the current time […]