Java and XML, Second Edition

Solutions to Real-World Problems

By Brett McLaughlin
August 2001
Pages: 528
ISBN 10: 0-596-00197-5 | ISBN 13: 9780596001971
starstarstarstarstar (4) (Average of 10 Customer Reviews)

This book has been updated—the edition you're requesting is OUT OF PRINT. Please visit the catalog page of the latest edition.

The latest edition is also available on Safari Books Online.

Book description

New chapters on Advanced SAX, Advanced DOM, SOAP, and data binding, as well as new examples throughout, bring the second edition of Java & XML thoroughly up to date. Except for a concise introduction to XML basics, the book focuses entirely on using XML from Java applications. It's a worthy companion for Java developers working with XML or involved in messaging, web services, or the new peer-to-peer movement.
Full Description

While the XML "buzz" still dominates talk among Internet developers, the critical need is for information that cuts through the hype and lets Java programmers put XML to work. Java & XML shows how to use the APIs, tools, and tricks of XML to build real-world applications, with the end result that both the data and the code are portable. This second edition of Java & XML adds chapters on Advanced SAX and Advanced DOM, new chapters on SOAP and data binding, and new examples throughout. A concise chapter on XML basics introduces concepts, and the rest of the book focuses on using XML from your Java applications. Java developers who need to work with XML, or think that they will in the future--as well as developers involved in the new peer-to-peer movement, messaging, or web services--will find the new Java & XML a constant companion. This book covers:
  • The basics of XML, including DTDs, namespaces, XML Schema, XPath, and XSL
  • The SAX API, including all handlers, the SAX 2 extensions, filters, and writers
  • The DOM API, including DOM Level 2, Level 3, and the Traversal, Range, CSS, Events, and HTML modules.
  • The JDOM API, including the core, a look at XPath support, and JDOM as a JSR
  • Using web publishing frameworks like Apache Cocoon
  • Developing applications with XML-RPC
  • Using SOAP and UDDI for web services
  • Data Binding, using both DTDs and XML Schema for constraints
  • Building business-to-business applications with XML
  • Building information channels with RSS and dynamic content with XSP
Includes a quick reference on SAX 2.0, DOM Level 2, and JDOM.
Post-purchase benefits:

Register your book | Submit Errata | Author's Articles | Author Interview | Author's Tips


Browse within this book

| Table of Contents | Index | Sample Chapter | Colophon

Book details

Second Edition: August 2001
ISBN: 0-596-00197-5
Pages: 528
Average Customer Reviews: starstarstarstarstar (4) (Based on 10 Reviews)


Featured customer reviews

Write a Review


Java & XML, 2nd Edition Review,  November 24 2005
Submitted by Anonymous Reader   [Respond | View]

Hi, Robert,
I has the same condition as you,
but I don't think it caused by version incompatiblity of Xerces and Tomcat,
the stackTrace say: "java.lang.NoSuchMethodException.."
but it's strange, the method just there!
---
My environment is:
win2003, j2sdk 1.4.2, soap 2.3.1, Xerces 1.2.3,
Tomcat 5.0
I has tried Xerces 2.6.2, it just version incompatible.


Java & XML 2nd edition,  August 28 2005
Rating: StarStarStarStarStar
Submitted by Bob H.   [Respond | View]

This book is dated, bad. It has a copyright of August, 2001. Much of the book references SAX 1.0, a dinosaur. Evidently, there has been a reprint in 2004 with a load of corrected mistakes. Unfortunately, the old books are still in the pipeline, because my purchase in August 2005 yielded the August 2001 version.

When compiling a crucial example in Chapter 3, a couple of screwy warnings occurred with the JFrame class. There is nothing in the errata referencing this problem. If you don't have a background with JFrame and Java Swing, you will not be able to shoot this bug. It is a shame that so many bugs get out in O'Reilly books, but that is what happens.

I have shot some in the past, but did not receive any acknowledgement from the O'Reilly crowd.


Java & XML, 2nd Edition Review,  April 29 2003
Rating: StarStarStarStarStar
Submitted by Antonio Rodriguez of the Columbia Java Users Group   [Respond | View]

This book contains an enormous wealth of information about Java's tying with the essentials of XML. I'd still recommend obtaining another book exclusively on the intricacies of XML, since only the basics are covered in this book. XML contains a lot more than the few pages that this book talks of it.

But XML is nothing without the software that interprets, handles and otherwise processes the format, and this book details this tying in with the Java language very well. Java parsers, APIs (SAX, DOM and JDOM), web services, everything is covered.

One book that your Java programming bookcase should not be without!!



Read all reviews


Java & XML, 2nd Edition Review,  November 11 2002
Rating: StarStarStarStarStar
Submitted by Robert   [Respond | View]

I agree with the excellence of this book. I haven't found such detailed description in WSDL and SOAP messages from other source. But I have a problem to running the SOAP messages example from Chapter 13. I use Tomcat 4.1.12 and SOAP 2.3.1, tried both JDK 1.3 and 1.4. The deployment seemed OK, but when I ran the Client, I got the following exception. From the discussion group of Apache SOAP, somebody suggested this might be a version incompatiblity of Xerces and Tomcat, but I tried to rename the xerces.jar to a_xerces.jar in %Tomcat_home%/common/lib directory to let it be loaded at the very beginning when Tomcat started (for JDK1.3) and put xerces.jar in %Tomcat_home%/common/endorsed and remove other parsers in this directory (for JDK 1.4, this is a new feature only in 1.4). But I kept getting this exception. I also tried other simple example from other resource and got the same response. So it seemed the problem was my environment, not the example. Does anybody know the solution? My OS is Windows XP Professional. Thanks a lot.

<?xml version='1.0' encoding='UTF-8'?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:Body>

<SOAP-ENV:Fault>

<faultcode>SOAP-ENV:Server</faultcode>

<faultstring>Exception while handling service request: javaxml2.OrderProcessor.purchaseOrder(org.apache.soap.Envelope,org.apache.soap.rpc.SOAPContext,org.apache.soap.rpc.SOAPContext) -- no signature match</faultstring>

<faultactor>/soap/servlet/messagerouter</faultactor>

<detail>

<stackTrace>java.lang.NoSuchMethodException: javaxml2.OrderProcessor.purchaseOrder(org.apache.soap.Envelope,org.apache.soap.rpc.SOAPContext,org.apache.soap.rpc.SOAPContext) -- no signature match

at org.apache.soap.util.MethodUtils.getEntryPoint(MethodUtils.java:194)

at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:548)

at org.apache.soap.util.MethodUtils.getMethod(MethodUtils.java:528)

at org.apache.soap.server.MessageRouter.invoke(MessageRouter.java:54)

at org.apache.soap.providers.MsgJavaProvider.invoke(MsgJavaProvider.java:125)

at org.apache.soap.server.http.MessageRouterServlet.doPost(MessageRouterServlet.java:308)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)

at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)

at java.lang.Thread.run(Thread.java:536)

</stackTrace>

</detail>

</SOAP-ENV:Fault>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>




Java & XML, 2nd Edition Review,  June 15 2002
Rating: StarStarStarStarStar
Submitted by Arthur Casale   [Respond | View]

The book assumes a much higher level of proficiency than I expected. It really (especially)glossed what it takes to set up the run time web server environment (setting up Tomcat server, etc.) A page or two of step-by-step instructions on what the CLASSPATH needs to look like and the Apache directory structure should look like would have saved me countless hours and emails. I realize there are web sites out there on Tomcat and it really isn't the focus of the book but in order to run the examples one shouldn't assume a familiarity. Authors forget that many folks are learning this without the benefit of an expert nearby.


Java & XML, 2nd Edition Review,  May 08 2002
Rating: StarStarStarStarStar
Submitted by Greggbert   [Respond | View]

This is one of those "must have" books for any Java developer today. It's a career saver when you need a quick example and some clear guidance. The chapter on JDOM alone is worth the price of the book !


Java & XML, 2nd Edition Review,  February 19 2002
Rating: StarStarStarStarStar
Submitted by Shailesh Deshpande   [Respond | View]

The perfect "hands on" book for Java Programmers wanting to play with XML.


Java & XML, 2nd Edition Review,  November 27 2001
Rating: StarStarStarStarStar
Submitted by Neil Laurance   [Respond | View]

At last. All those pesky acronyms - SAX, JDOM, SAXP etc... - explained. In fact - better than explained, described with such clarity and with so many interesting examples that I was disappointed to finish the book. Nice one!!


Java & XML, 2nd Edition Review,  September 27 2001
Rating: StarStarStarStarStar
Submitted by Zohra Hemani   [Respond | View]

This is an excellent book and exactly what I needed. I had been looking for a good book that actually tells you how to work with SOAP and give examples in Java and this is the best one I found!!! Good Job! :)


Java & XML, 2nd Edition Review,  September 24 2001
Rating: StarStarStarStarStar
Submitted by Ben Bruhl   [Respond | View]

Excellent update to the 1st edition. Given the changing environment that the topic involves, the author covers the information in a clear and detailed manner. The examples were very handy in explaining how these different standards can be implemented using Java. Although it was covered, I would have liked to see more detail on HTTP handling servers for both SOAP and other XML format messages via servlets.

Great addition to my library!


Java & XML, 2nd Edition Review,  September 11 2001
Rating: StarStarStarStarStar
Submitted by Bill Woods   [Respond | View]

I just wanted to be the first one to respond.

Even though I stll have yet to buy it, I scanned through a copy

that a co-worker friend just bought over the weekend and I must say that

from what I saw, I will definitly get it SOON!

This book looks like just what we as Java developers have been looking and

hoping for quite a while.

Good work!

- Bill




Media reviews

"Excellent book for Java programmers who need to understand how to handle XML."
--Ken North, Dr Dobbs

"Was I impressed with this book? Indeed I was! The content is both timely and accurate, the reading is easy and enjoyable--a very rare achievement."
--Java Desk, Israel, Nov 2001

"In short, if you are a Java programmer that needs to know how to implement XML in Java, then you should have this book."
--vulinhnguyen, Java and Web developer, Enterprise Java Books List, amazon.com

"Best book about Java and XML"
--Naser Rezai, Great Java collection, amazon.com

"Interesting information on using XML with Java, including JDOM which was created by the author."
--Randy Tamura, Domino Web Development, amazon.com

"A fine introduction into both tools with enough meat to make developers happy."
--Jeffery L. Weeden, Information Architecture and Usability, amazon.com

Best of 2001 Award; Computing and Internet, Fatbrain.com

"Practical, informative and well-written, this book is ideal for professionals who are either working with Java and XML, or considering doing so."
--Tim Anderson, amazon.uk

"definitely recommended"
--R.K., fatbrain.com

"One of the bibles of the XML developer has to be Brett McLaughlin's 'Java and XML.'"
--Simon Bisson, PC Plus, Jan 2002

"If you are a Java developer and you are going to be working with XML then this book is required reading. The coverage of the Java/XML APIs is excellent. 9 out of 10 horseshoes"
--Thomas Paul, javaranch.com, Jan 2002

"Good book on Java and XML. Well written, covers lots of things and usecases for XML. The author is one of the authors of JDOM and has excellent XML knowledge."
--Stephan Schmidt, java-channel.org

"This book contains an enormous wealth of information about Java's tying with the essentials of XML...One book that your Java programming bookcase should not be without!"
--Columbia Java User Group

Hide extended reviews


See larger cover