Chapter 7. Java and XML

Extensible Markup Language (XML ) has become an essential technology for enterprise applications. The XML specification[28] allows users to define unique and structured document formats, allowing for easy and flexible data exchange between applications. Since the syntax of an XML document is bound by a public specification, XML documents can be read and manipulated by a wide variety of tools. Because XML documents are text-based, they can be easily transmitted between different systems using a number of transportation mechanisms, from JMS to HTTP.

XML documents can be freely structured, although they must abide by a basic set of XML rules that define a well-formed document. More commonly, however, the document structure is further defined by a Document Type Definition (DTD). With a standardized DTD, enterprise applications can exchange data without knowledge of each other’s native formats. Industry working groups have defined DTDs for everything from bank transactions to medical records to electronic books. DTDs are very common, although they have been partially supplanted by XML Schemas, a more sophisticated way of describing the structure of an XML document that, among other things, supports defining data types.

The advantages of combining Java and XML are obvious—a cross-platform language and a cross-platform data specification. We don’t have space here to discuss XML itself in depth—for more information, try Learning XML by Erik T. Ray (O’Reilly). This ...

Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.