A review of XSLT

XSLT is in many ways a great language. It is a scripting language designed to be used for manipulating data in XML format, and is a fairly pure functional language (tail recursion, no input/output, variables constant, etc.).

The largest problem with it is the unbelievable idea of having the language itself written in XML. The style is similar to Python, but whereas Python is so concise as to not have opening or closing braces at all, XSLT goes the whole way with full tags. I can honestly say that I have never seen a more verbose language (used for real code). In actual lines of code it is about the same as C, but where C has many lines with just a single ‘}’, XSLT might have ‘</xsl:otherwise>’.

Now, where it really shines is working with XML data. XSLT uses XPATH as a language within a language for drilling down into a data tree is extremely powerful and concise, and is something absent in other functional languages like Python or OCaML. It has a neat (and fairly fast) way of looking up data, which is fantastic when using the language for its original purpose as a data manipulation tool. All procedural calculation (i.e. evaluation of expressions) is done in XPATH also, which is very nice, but branching and function calls are written out in the cumbersome XML syntax. Actually doing complex calculations in XSLT is a bit of a waste of time, which I found out when I tried writing matrix manipulation programmes to investigate some vector spaces.

Is XSLT really useful? I think not hugely, except in certain niches, and unless you know you need it, and have the data in XML already, I would recommend against learning it.

Please write a comment if you liked the post.
http://