Book HomeJava and XML, 2nd Edition

Preface

When I wrote the preface to the first edition of Java & XML just over a year ago, I had no idea what I was getting into. I made jokes about XML appearing on hats and t-shirts; yet as I sit writing this, I'm wearing a t-shirt with "XML" emblazoned across it, and yes, I have a hat with XML on it also (in fact, I have two!). So, the promise of XML has been recognized, without any doubt. And that's good.

However, it has meant that more development is occurring every day, and the XML landscape is growing at a pace I never anticipated, even in my wildest dreams. While that's great for XML, it has made looking back at the first edition of this book somewhat depressing; why is everything so out of date? I talked about SAX 2.0, and DOM Level 2 as twinklings in eyes. They are now industry standard. I introduced JDOM, and now it's in JSR (Sun's JavaFigure 0 Specification Request process). I hadn't even looked at SOAP, UDDI, WSDL, and XML data binding. They take up three chapters in this edition! Things have changed, to say the least.

If you're even remotely suspicious that you may have to work with XML in the next few months, this book can help. And if you've got the first edition lying somewhere on your desk at work right now, I invite you to browse the new one; I think you'll see that this book is still important to you. I've thrown out all the excessive descriptions of basic concepts, condensed the basic XML material into a single chapter, and rewritten nearly every example; I've also added many new examples and chapters. In other words, I tried to make this an in-depth technical book with lots of grit. It will take you beginners a little longer, as I do less handholding, but you'll find the knowledge to be gained much greater.

0.1. Organization

This book is structured in a very particular way: the first half of the book, Chapter 1, "Introduction" through Chapter 9, "JAXP", focuses on grounding you in XML and the core Java APIs for handling XML. For each of the three XML manipulation APIs (SAX, DOM, and JDOM), I'll give you a chapter on the basics, and then a chapter on more advanced concepts. Chapter 10, "Web Publishing Frameworks" is a transition chapter, starting to move up the XML "stack" a bit. It covers JAXP, which is an abstraction layer over SAX and DOM. The remainder of the book, Chapter 11, "XML-RPC" through Chapter 15, "Data Binding", focuses on specific XML topics that continually are brought up at conferences and tutorials I am involved with, and seek to get you neck-deep in using XML in your applications. These topics include new chapters on SOAP, data binding, and an updated look at business-to-business. Finally, there are two appendixes to wrap up the book. The summary of this content is as follows:

Chapter 1, "Introduction"
We will look at what all the hype is about, examine the XML alphabet soup, and spend time discussing why XML is so important to the present and future of enterprise development.

Chapter 2, "Nuts and Bolts"
This is a crash course in XML basics, from XML 1.0 to DTDs and XML Schema to XSLT to Namespaces. For readers of the first edition, this is the sum total (and then some) of all the various chapters on working with XML.

Chapter 3, "SAX"
The Simple API for XML (SAX), our first Java API for handling XML, is introduced and covered in this chapter. The parsing lifecycle is detailed, and the events that can be caught by SAX and used by developers are demonstrated.

Chapter 4, "Advanced SAX "
We'll push further with SAX in this chapter, covering less-used but still powerful items in the API. You'll find out how to use XML filters to chain callback behavior, use XML writers to output XML with SAX, and look at some of the less commonly used SAX handlers like LexicalHandler and DeclHandler.

Chapter 5, "DOM"
This chapter moves on through the XML landscape to the next Java and XML API, the DOM (Document Object Model). You'll learn DOM basics, find out what is in the current specification (DOM Level 2), and how to read and write DOM trees.

Chapter 6, "Advanced DOM"
Moving on through DOM, you'll learn about the various DOM modules like Traversal, Range, Events, CSS, and HTML. We'll also look at what the new version, DOM Level 3, offers and how to use these new features.

Chapter 7, "JDOM"
This chapter introduces JDOM, and describes how it is similar to and different from DOM and SAX. It covers reading and writing XML using this API.

Chapter 8, "Advanced JDOM"
In a closer examination of JDOM, we'll look at practical applications of the API, how JDOM can use factories with your own JDOM subclasses, and JAXP integration. You'll also see XPath in action in tandem with JDOM.

Chapter 9, "JAXP"
Now a full-fledged API with support for parsing and transformations, JAXP merits its own chapter. Here, we'll look at both the 1.0 and 1.1 versions, and you'll learn how to use this API to its fullest.

Chapter 10, "Web Publishing Frameworks"
This chapter looks at what a web publishing framework is, why it matters to you, and how to choose a good one. We then cover the Apache Cocoon framework, taking an in-depth look at its feature set and how it can be used to serve highly dynamic content over the Web.

Chapter 11, "XML-RPC"
In this chapter, we'll cover Remote Procedure Calls (RPC), its relevance in distributed computing as compared to RMI, and how XML makes RPC a viable solution for some problems. We'll then look at using XML-RPC Java libraries and building XML-RPC clients and servers.

Chapter 12, "SOAP"
In this chapter, we'll look at using configuration data in an XML format, and see why that format is so important to cross-platform applications, particularly as it relates to distributed systems and web services.

Chapter 13, "Web Services"
Continuing the discussions of SOAP and web services, this chapter details two important technologies, UDDI and WSDL.

Chapter 14, "Content Syndication"
Continuing in the vein of business-to-business applications, this chapter introduces another way for businesses to interoperate, using content syndication. You'll learn about Rich Site Summary, building information channels, and even a little Perl.

Chapter 15, "Data Binding"
Moving up the XML "stack," this chapter covers one of the higher-level Java and XML APIs, XML data binding. You'll learn what data binding is, how it can make working with XML a piece of cake, and the current offerings. I'll look at three frameworks: Castor, Zeus, and Sun's early access release of JAXB, the Java Architecture for XML Data Binding.

Chapter 16, "Looking Forward"
This chapter points out some of the interesting things coming up over the horizon, and lets you in on some extra knowledge on each. Some of these guesses may be completely off; others may be the next big thing.

Appendix A, "API Reference"
This appendix details all the classes, interfaces, and methods available for use in the SAX, DOM, JAXP, and JDOM APIs.

Appendix B, "SAX 2.0 Features and Properties"
This appendix details the features and properties available to SAX 2.0 parser implementations.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.