O'Reilly logo

Java™ Web Services Unleashed by Mark Wutka, Joseph Weber, Arthur Ryman, K. Scott Morrison, Benoît Marchal, Matthias Kloppmann, Steven Haines, Darren Govoni, Francisco Curbera, Frank Cohen, Robert Brunner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using JAXB-Built Classes

As soon as the JAXB has built classes that represent an XML document, it is a simple matter to use them. The operations that make XML processing complete include:

  • Reading an XML document

  • Modifying an XML document (adding, removing, and updating nodes)

  • Writing an XML document

Reading an XML Document

Recall from earlier in the chapter that the process of building a Java object representation of an XML document in JAXB terms is referred to as unmarshalling. Therefore, the process for reading an XML document that adheres to the chosen DTD is to call the Java class representing the root node's unmarshal() method.

In the example, the root node is <books> and is represented by the Books class. The Books class has four unmarshal() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required