by Sal Mangano
Published by O'Reilly Review by Ben Galbraith For a change of pace, I've decided to review this book in a sort of journal format. Day 1 I've just started working with XSLT and Xalan recently and so am excited to get my hands on this book. However, it's failed on my first test. I needed to write an extension to my XSL stylesheet to access a method in a Java class. I've looked this up before on Apache's Xalan website, but I wanted to see if this book had a good "recipe" for it. Sadly, the book was vastly lacking in this area. First, the XSL snippet that showed how to reference a Java function using the "short-cut" Xalan syntax suffered from a severe typo/omission that rendered it useless (p.521). Worst of all, the explanation of how to write the Java method itself was flat-out wrong. The book claimed that a certain method signature with certain parameters including Xalan-specific objects was the only way to write a Java extension to Xalan's XSLT engine. Uh, no. Overall the section on writing Java extensions to XSL stylesheets is severely lacking to the point of being useless. Day 3 I needed to write a simple XPath query to select all tags with a certain attribute/value combination. Simple, right? I'd imagine this would come up often, and so expected that this book would have a couple of ways to accomplish it. Not so. In fact, this book contains almost nothing on XPath. The author informs readers in the beginning of the chapter on selecting nodes (Chapter 4) that readers wishing to learn more about XPath should grab another book. Wow. Considering how useless XSLT is without XPath, I'm really surprised that the author takes this position. Day 4 If you can believe it, I'm currently transforming some XML into TeX for fine-grained control over PostScript and PDF generation. I figured with the vast body of TeX/LaTeX extensions, I'd have have plenty of options. It's turned out pretty well, but I'm interested in seeing how I could do the same thing with XSL-FO. Unfortunately for me, this book doesn't have anything on XSL-FO; the author does demonstrate that he is aware of its existence, but apparently it just didn't make the cut. Sadly, there is in fact no mention of any XML to PDF/PS recipes in the book. SVG is covered at length, with recipes for charts and graphs and grids (oh my!). Day 6 I need to transform certain strings in my XML from this-format to This Format. This book includes a large section of string processing, so I'm hopeful my losing streak may be averted... and it almost was. The author included a great example for striping the dashes out of my strings, but included nothing that looks to help with changing all the first letters to uppercase. The text replacement recipe I did find was clear and easy to follow. Conclusions This book hasn't helped me much with my own XSLT problems yet, so I decided to read through large portions of it to get a better feel for its content and see what it does help with. The introduction of the book sounds good; the author talks about his "longing for a cookbook" when he first began working with XSLT, and makes a case for developers not familiar with XSLT to get on the bandwagon -- and presumably, buy this book to help with the process. However, the actual book fails to deliver on this promising introduction. There is little material for those genuinely new to XSLT -- you are expected to become fluent on your own. By not including anything on XPath, the author guarantees that beginners will need to buy at least one another book. What this book does do is build on your solid foundation of XSLT techniques to help you with common (and exotic) XSLT tasks. Recipes for generating text, XML, HTML, and SVG are included; however, since I am doing none of these at present, the topics don't interest me. The book's section on string handling seems quite good, and although it does have extensive date handling recipes, I haven't looked closely at these. Among the exotic tasks covered are: Generating C++ classes from XMI (UML described in XML), generating various types of C/C++ code from XML, and converting Visio documents to SVG format. I was a bit miffed to see no Java code generation recipes, and am still annoyed with the earlier-mentioned inaccurate Java integration recipe. So to wrap up, the book is certainly well-written, and most of its content seems to be accurate. However, I believe the omission of XPath to be disastrous, the lack of XSL-FO to be untimely (especially when proprietary formats such as Excel and Visio are covered!), and in general, the selection of recipes to be unhelpful for me -- your mileage may vary. Beginners might make this their second or third book; experts will want to check out the table of contents and see if they need to accomplish any of its covered tasks. Ben Galbraith ben [shift-2] galbraiths [point] org
|