XML Hacks


Author: Michael Fitzgerald

ISBN:

0-596-00711-6

Publisher: O'Reilly (2004)

Reviewed by: Dave Cross

As a Perl programmer, my first instinct when given some XML to process is to grab the appropriate Perl module (probably XML::XPath or XML::LibXML) and use that to do whatever I need to. Although that usually gets the job done, reading this book opened my eyes to a number of other XML processing tools that will sometimes be more useful than a Perl program. Actually Perl doesn't get mentioned at all in the index, whereas Java gets half a column of entries.

A lot of the book isn't aimed at the kind of person who is comfortable firing up an editor writing a program. Many of the hacks introduce ready-made applications that handle a number of different XML tasks. For example there are applications that, given an XML document, will take a first pass at creating an XML Schema or DTD for the document. This is something that would be an interesting project to write for yourself, but if you just need the schema it's nice to know that someone else has already written the application for you.

One of the most interesting chapters for me was the one about editing XML. My usual tool for that is xml-mode in Xemacs but the book introduced me to a number of other possibilities. The one that particularly caught my eye was nXML for Emacs. Unfortunately it's not currently compatible with Xemacs, so I need to try out some of the other editors that are discussed.

Like all of O'Reilly's Hacks books, this book is aimed at a very wide audience. Some of the tools are Open Source and some of them are commercial. Some of them run on only one platform and some of them will run anywhere. That has the potential to be a little frustrating when you find a tool that looks really useful, only to find out that it only runs on Windows. Fortunately the authors are aware of this problem and make a real effort to present tools that run on as wide a range of platforms as possible. If one hack presents a tool that only runs on Windows then you can be sure that the next hack has a similar tool that runs somewhere else.

The audience is diverse along other dimensions too. There are hacks aimed at people who will just want to save a Word document in DocBook format (hint: use OpenOffice) and at the other end of the spectrum there are hacks aimed at people who want to create SOAP services. There are hacks aimed at all levels of producing and using XML.

It's an inevitable consequence of this type of book that not everyone is going to find all of it useful. But the authors are obviously experts in their field and they explain themselves very clearly. I thought I knew a lot about processing XML but I discovered a lot of new and interesting things from this book. If you want a good overview of the various ways that XML can be useful to you, then this book would be a very good start.