Chapter 5. XML Best Practices

Brett McLaughlin

It’s almost impossible for programmers not to use XML in modern enterprise applications. In fact, programmers are finding it increasingly common to read and write XML, either from other components within the same application or from external sources such as a web service.

In this chapter we’ll discuss several types of XML-based best practices. First, we’ll discuss several ways you can better structure your XML, regardless of the API you choose to use. From there, we’ll look at tips for using three significantly different XML APIs included with a Java 2 Enterprise Edition (J2EE) distribution. We’ll also discuss how, in addition to good document authoring, it is important that your XML manipulation code be efficient and well-designed. This chapter examines several best practices that will get you on the right track to effective Java and XML programming, and keep you sleeping at night.[7]

[7] Some of the concepts throughout this chapter are based on tips I wrote that were originally published online at the IBM DeveloperWorks site (http://www.ibm.com/developer). My thanks to IBM for allowing their modification and reuse.

Get Java Enterprise Best Practices 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.