XSLT Powers a New Wave of Web Applications
We still have a lot to learn about XSLT as a profession. As fast as its use is expanding, there remain fewer programmers competent in XSLT than, say, Object Pascal.
Another hurdle in XSLT's diffusion, along with its unconventional XML-based syntax and confusing deployment, is its functional or applicative semantics. Most computing languages that appear in Linux Journal are more or less procedural: Java and C programs instruct a processor to perform one operation, then another, then another. Proceduralism is wrapped up in the how of computation.
XSLT is related to Lisp in its functionality. Good XSLT programs express the “what” of a desired result. Instead of a focus on sequence-in-time, XSLT operates on whole XML documents or well-formed fragments to yield results. This is called functional (to evoke the model of mathematics), where functions turn inputs into outputs without side effects or variation in time. Moreover, mathematical functions can be composed (stacked) in combination. Typical XSLT semantics express several different transformations without specification of their sequence-in-time. Stylesheets are applied simultaneously.
XSLT has variables, but they are immutable. They can receive only one value and cannot, in particular, be looped, as in
for (i = 0; i < 10; i++);
Parametrized or repetitive operations are done through explicit recursion and iteration. The syntax of XSLT variable use is rather ugly, as it must fit within XML's constraints. In C or Java we might write
if (level > 20)
code = 3;
else
code = 5;
To approximate that in XSLT, we need
<xsl:variable name = "code">
<xsl:choose>
<xsl:when test = "$level > 20">
<xsl:text>3</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>5</xsl:text>
</xsl:otherwise>
</xsl:choose
</xsl:variable>
Such exercises illustrate that, while XSLT has enough abstract
power to handle general problems by itself, it's often best used in
a dual-programming mode. XSLT's strengths generally lie in template
processing, pattern matching and sorting and grouping XML elements.
Steve Ball, a principal for consultancy Zveno Pty. Ltd., does as
much as practical with XSLT, then embeds it in an application with
another language to handle interfaces to external systems,
including filesystems and user view.
Most popular among the developers I've encountered during the last six months are Java and Tcl, although Python, C, Perl and other partner languages also manage XSLT engines more or less adequately. Moreover, XSLT also defines extensibility mechanisms that allow developers to provide new semantics within XSLT: “extension elements”, “extension functions” and “fallback processing”.
XSLT's ultimate destiny remains unclear. In this, also, it's a bit like Java. Five years ago, Java's purpose appeared to be to construct cute visual applets. As we've discovered since then, heavy-duty enterprise servers actually make better hosts for the best Java programming. We're still at an early stage in deciding when to use XSLT. ReportLab, Inc., for example, is an enterprise vendor that delivers products and services having to do with high-quality report generation to some of the largest organizations in the world, including Fidelity Investments and American Insurance Group. ReportLab founder Andy Robinson explained to me the deep experience his development team has in projects that transform XML. Each project his company has fulfilled has involved coding in a lighter-weight scripting language rather than relying on XSLT. Even though XSLT is specialized for XML transformation, his consulting teams have found it easier to use Python as a more general-purpose, but powerful language.
My special thanks to Rolf Ade, who contributes both to tDOM software and especially to my understanding of it.

Cameron Laird is a full-time developer and vice president of Phaseit, Inc. He also writes frequently on programming topics and has published several articles during the last year on XSLT. He's currently preparing a training course on the language.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Home, My Backup Data Center
- Tech Tip: Really Simple HTTP Server with Python
- Please correct the URL for Salt Stack's web site
1 hour 15 min ago - Android is Linux -- why no better inter-operation
3 hours 30 min ago - Connecting Android device to desktop Linux via USB
3 hours 58 min ago - Find new cell phone and tablet pc
4 hours 56 min ago - Epistle
6 hours 25 min ago - Automatically updating Guest Additions
7 hours 34 min ago - I like your topic on android
8 hours 20 min ago - This is the easiest tutorial
14 hours 56 min ago - Ahh, the Koolaid.
20 hours 35 min ago - git-annex assistant
1 day 2 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
Re: XSLT Powers a New Wave of Web Applications
While this article is an interesting introduction, I am very surprised that it would manage to not even mention libxslt which is probably one of the fastest, most reliable, and most frequently deployed processors, and AxKit which is similar to Cocoon in various ways, but less overdesigned and implemented within Apache using a powerful combination of C and Perl. Both are extremely succesful projects, with constantly growing user bases.
As for XSLT being more used by Tcl and Java folks than by Perl, Python, and C folks I think that's simply wrong, and is no more than an impression gathered from an incomplete sample.
Finally, as the author mentions benchmarks it would be nice to see them! I have no doubt that tDOM beats any pure Java XSLT processor flat, but what of the others? Beating libxslt (both for memory and for speed) appears to me to be a tough task. Even if tDOM were faster, I very much doubt it would be "twice as fast" as claimed rather boldly in this article.
Mod_xslt - ultimate XSLT engine for the web
Check out http://freshmeat.net/projects/mod_xslt_ln/
and http://linuxnews.pl as an example of XML/XSLT technology.
With the mod_xslt you can for example pass the arguments to the XSLT programs.
Example of this is forum system on Linuxnews.pl
regards,
Pumpkin
mod_xobjex for Apache 1.3.x uses libxslt
Similar to mod_xslt, mod_xobjex is a lighter, faster alternative that uses Daniel Veillard's libxslt (which is blazingly fast). With mod_xobjex, web applications are built with pure XSLT. mod_xobjex converts the HTTP Request into XML to which the requested XSL template is applied. Download it at xobjex.com.
XSLT, DOM, SQL and the web
This paper may be of interest to those looking to publish data from relational databases on the net using XSLT.
Re: XSLT Powers a New Wave of Web Applications
www.zvon.org hosts an excellent XSLT reference - a lot easier than reading the W3C documents :-)
If you just want to try out some XSLT examples, here's (http://www.julien-dubois.com) a server-side XSLT transformer, so that you don't need anything on your PC to get you started.
Re: XSLT Powers a New Wave of Web Applications
The "How To Start XSLT Programming" link mentions the 0.63 code snap shot. The xslt engine in tDOM-0.7test is much improoved in XSLT compliance. Grab it from
http://sdf.lonestar.org/~loewerj/tdom.cgi
rolf ade
Re: XSLT Powers a New Wave of Web Applications
And for those who want a fast and compliant XSLT
engine, use xsltproc available from the libxslt package on
most distributions. It is used by KDE and Gnome to generate
the HTML version of their DocBook docs.
Check the web page
and download area for further
informations, packages and the source !
Daniel Veillard
Re: XSLT Powers a New Wave of Web Applications
Yes! Daniel Veillard's libraries and utilities are definitely the way to go for production-quality work with XSLT; they chew through huge groves with speed. It's a true open-source success and deserves more appreciation.
If you're interested in tracking XSLT's growth and maturation, check out the newest version of Michael Kay's SAXON - larger, slower, but also very cool.
Paul Ford
Re: XSLT Powers a New Wave of Web Applications
The way I got started with XSLT was Sablotron; which is available here.. If you use perl, it is nice because it's a perl module; and it also has a command line vesion similar to the tcl command mentioned above. You don't need TCL though; just configure && make && make install.