TechBookReport logo




Keywords: Java, web services, SAX, DOM, JDOM, JAXP, TrAX

Title: Processing XML with Java

Author: Elliotte Rusty Harold

Publisher: Addison Wesley

ISBN: 0201771861

Media: Book, web

Level: Intermediate Java, Beginner XML

Verdict: Very highly recommended

XML is the nearest we've got to a universal glue to stick together disparate operating systems, applications and data formats. In concept it's remarkably straightforward, hence it's initial appeal. With the advent of real-life web services, (as opposed to the hype we've endured in the last couple of years), the take-up of XML is rapidly increasing.

However, for somebody just beginning to dip their toes in the water, the reality of XML appears considerably trickier than the simple concept that drives the technology. There is a daunting array of competing parsers, APIs, file formats, schemas, DTD's and who knows what else. Luckily, the pleasingly named Elliotte Rusty Harold is there to guide the Java programmer through the murk.

To begin, though, it's important to stress that this isn't an introduction to XML in all it's glory. The book assumes that the reader is already familiar with XML, and, obviously it's aimed at the Java developer. However, the opening chapter on XML is more than adequate, in our opinion, to go over the basics of syntax, validation, stylesheets etc. Despite what the author states in his preface, it's possible to use this book even if you have only the vaguest idea of what XML is. What you will need to have is some development experience with Java, do not expect to be taught that and XML?

The first part of the book introduces not just XML, but also the related issues of protocols - HTTP, SOAP, RPC etc. For anybody interested in web services this is essential material and is not to be skipped. It provides a basic primer on reading and writing XML, and gives a quick run-down on the different parsers, from SAX and DOM to proprietary affairs such as ElectricXML.

This is followed by the next three parts of the book which look in more detail at SAX, DOM and JDOM. The same examples are used throughout, which makes it easy to contrast the strengths and weaknesses of these different offerings. The tone is consistent, and there is no feeling of being patronised or spoon-fed. Mr Harold talks like a developer to other developers, and it's very welcome too. The Java code is often very useful, and there are useful classes and snippets that can be lifted directly into your own code.

XPath and XSLT are covered in the final part of the book. Again the standard of material is high, and there is more than enough to get a developer started with code. As in other sections of the book, the author discusses the pros and cons of different tools and where they are regarding standards and interoperability.

In all, this is a book that's definitely one to have if you are interested in using XML with your code. Not only is the material explained well, and illustrated using solid code and examples, the comments, gotchas and other asides do well to steer the reader away from the danger areas. This one is very highly recommended.


Hit the 'back' key in your browser to return to subject index page

Return to home page