About the Reviewer
Bart Vrancken has a Masters degree in Informatics. He is a Sun Certified Java Programmer and works as a Java-architect for Datasoft Services. He fills most of his "free" time being chairman of a solidarity choir, called Caminhando.
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.

Java & XML



Author(s) Brett D. McLaughlin & Justin Edelson
Publisher O'Reilly
PubDate 2006, edition #3 (#2 , #1)
Reviewer Bart Vrancken
Purchase and help Javalobby



Table of Contents




One Minute Review

Positives

  • Wealth of information about the generalized toolkits
  • Good reference material

Negatives

  • Sometimes boring, because of the wealth of information

Sections

Intent & Audience

The book wants to be a companion for all those JAVA-developers who must use XML, or will be in the future. In short, everybody should read it. For the last chapter, the authors assume you know JSP's and servlets (and you read all the prior chapters), but in overall, they assume you have already a little knowledge of XML. (and JAVA of course ...)

back to top Back to top

Relevance of material

The book is a good reference about a lot of different toolkits, that you can use, making your XML-life easier. It is directly relevant if you want to create or read some RSS-feeds, otherwise it is more a general starting point, for whatever you want to do with the given XML in your JAVA-programs.

back to top Back to top

Chapter highlights

The first chapter is traditional an Introduction. In this case, it is a quick introduction to XML and transformations of XML.

Chapter 2, Constraints shows 3 different ways to define the structure of XML documents. It covers the following standards: DTDs, W3C XML Schemas, and RELAX NG schemas, shows you how to use them and how to validate your documents against them and how to switch between these standards.

The following chapters discusses different APIs for handling XML documents.

Chapter 3 and 4 are about the simple API for XML or in short SAX. First the basics are covered: how to use the API, setting up a parser like Xerces and how to parse a document with it to do something useful with the content of that document.
In chapter 4, validation is handled by explaining the standard mechanism for setting parser behaviour in SAX2 through the use of properties and features. The chapter contains also a part about explaining extension interfaces, concretely LexicalHandler and DeclHandler. These are interfaces that SAX parsers are not required to support, so you better be careful with them. Finally filters are discussed, specially XMLwriter.

The next 2 chapters are handling DOM. Chapter 5 introduced and detailed the DOM API, and specifically what is called the DOM core. Chapter 6: DOM Modules goes through the DOM level 2 and DOM level 3 modules, like Traversal, Range, Events, Style, HTML, Load and Save, and Validation.

JAXP is an API from Sun, providing everything you can find in SAX and DOM, with some extras to it. Chapter 7 is covering the new features of JAXP 1.3, including XPath and the validation APIs.

Chapter 8, Pull Parsing With StAX covers the Streaming API for XML, with a comparison between the cursor API and the event iterator API. The chapter concludes with StAXs predecessor XMLPull, which is suitable for memory-constrained environments.

The following 2 chapters are Java-specific alternatives to DOM.

Chapter 9: JDOM is focusing on properties, beginning with the conversion of Java properties to XML properties. Further the chapter explains some additional classes, like the Namespace class, XSLTransformer, XPATH, EntityRef and different filters. Concluding with common issues while using JDOM.

Chapter 10: dom4j is more about the different ways of travelling through XML-documents, including Iterator, Lists, and Index-Based Access, XPath and the Visitor pattern. Also transformations and special purpose factories that comes with dom4j are included in this chapter.

Chapter 11: Data Binding with JAXB covers both the specifications of JAXB 1.0 and JAXB 2.0. The reference implementation is Sun's Java Web Services Developer Pack and for making it very easy, the download and installation procedures are given. More interesting is the big section about how to use JAXB. At the end of this chapter, XMLBeans and Castor are treated as alternative frameworks for Data Binding.

The last chapters are more about specific XML applications, instead of generalized toolkits for processing XML documents.

Chapter 12 is dedicated to the different flavours of RSS. After an introduction of the different variants of RSS, the open source RSS library ROME (RSS and Atom Utilities) is used as tool to create and read RSS-feeds.

The last real chapter (Chapter 13. XML As Presentation) is going over the uses of XML in the model-view-controller pattern and most of all about the use of it in the presentation layer. First JSTL with his XML tag library and XSLT are tackled. Then the chapter continues with an explanation about the XMLHttPRequest; the cornerstone of AJAX to finish with Flash and Flex.

Chapter 14: Looking forward is giving pointers to XML Appliances, XML Databases, XQuery, Fast Infoset and links to different community sites.

There is also an appendix about SAX features and properties.

back to top Back to top

Rating

If you need to know a lot about the use of XML in Java (and who doesn't need that), the book gives you the needed information. Sometimes it was a bit boring, because of the wealth of given generalized toolkits. But if I use one of those toolkits, I know where I can get relevant information about it. I recommend it more as a book of references, than a book you should read from start to finish.

Relevance
Readability
Overall

back to top Back to top

Resources

Working with XML: The Java/XML Tutorial
Processing XML with Java
Xerces
Apache's page for xml

Purchase this book on Amazon and help Javalobby.