Main Page

Previous Section Next Section

Chapter 9: JAXP


Java API for XML Processing (JAXP) enables applications to read, write, manipulate, and transform XML data. Chapter 3 talked about XML standards and what they mean to developers. This chapter provides the reader an insight into the JAXP API and it provides a standard interface from Java applications, leveraging the same XML standards. It is assumed that the reader is sufficiently familiar with XML; this chapter is not intended to be a tutorial on XML.

From an architect's perspective, XML usage in an application can be divided into two broad categories.

  • Presentation-centric: XML meant for rendering, for example, an XHTML page

  • Data-centric: XML that represents data-for example, a purchase order passed between business partners

We envision that Web services will primarily use data-centric XML unless they are being used for content delivery to clients. It is interesting to note that, contrary to the general perception, the liklihood of developing Web services in Java situations where direct manipulation of XML content is required would actually be minimal. As subsequent chapters will detail, some of the other APIs, such as JAXR, JAX-RPC, JAXM, and JAXB, provide a higher level of conceptual abstraction for Java applications. Some examples of situations that would require such manipulations and direct use of JAXP would include accepting data from business partners asynchronously, validating such data against predefined schemas, transforming XML content in different rendering formats, reading configuration information in system components, and so on.

Previous Section Next Section

JavaScript Editor Java Tutorials Free JavaScript Editor