Review: XSLT Quickly · 463 words posted 07/09/2001 04:57 PM
The best thing about “XSLT Quickly,” (Manning, 2001) by Bob DuCharme, is what you won’t find in it: no jokes, no padding, no soapboxes. The trend toward bloatware has metastasized in the publishing community, but Mr. DuCharme is refreshingly immune. If you need to learn how to transform your XML documents, “XSLT Quickly” is the best place to begin.
Extensible Stylesheet Language Transformations (XSL) allows you to convert Extensible Markup Language (XML) documents into other formats. XML is sexy these days, so XML books abound. There aren’t many titles, however, that actually tell you what to do with the XML once you’ve created it. Most browsers, after all, don’t handle XML natively, so in order to present an XML document to an end user you often must change its format. This is where XSLT steps in.
The book opens with a brief XSLT tutorial that covers simple actions like deleting and renaming elements and attributes. The bulk of the book, however, consists of an “XSLT user’s guide.” In this section you can find answers to most of the issues you will encounter when working with XSLT: flow control, XPath, string manipulation, and more.
DuCharme is a longtime XML developer, and his knowledge informs the book with useful examples. For instance, suppose that you have a static legacy website containing tabular data that you’d prefer to move into an XML file or database. DuCharme shows you how, by numbering your elements in the style sheet and giving them meaningful names, you can perform the transformation in less than fifteen lines of code. This example alone is worth the price of the book.
DuCharme elects mostly to avoid discussing the quirks and exceptions of the various XSLT parsers. This decision is sensible, since such parsers are numerous and constantly changing. You will find, though, that in order to apply his examples in the real world you will need to refer to your particular parser’s documentation. When “XSLT Quickly” does include parser-specific tips, they sometimes clash with the parser’s documents. For instance, DuCharme claims that msxml3.dll does not recognize xsl: message elements, but the MSXML docs state otherwise and a quick test of the code shows that the parser does, in fact, respond to xsl: message in a predictable fashion. That’s not a major flaw in the book, but it does enforce the perception that keeping track of parser quirks is a losing battle best not fought in a bound publication.
On the whole, “XSLT Quickly” is an excellent XSLT resource. It’s ideal as a tutorial for beginners or as a reference for more experienced developers. The price is right – less than $30, and the book easily pays for itself in time saved. Let’s hope to see more XML/XSL titles from Bob DuCharme and Manning Publications.
* * *

