15.2 Challenges for Small Devices XML and Java champion similar ideas such as open interface, platform independence, and object-oriented data. XML support on the Java platform is traditionally very strong. All popular XML standards are supported on the J2SE and J2EE platforms. However, XML support on the J2ME platform, especially CLDC/MIDP platform, is still in development. XML-compatible mobile clients are slow to emerge because of the additional processing time and bandwidth required by XML tags. For example, the sample applications in Chapters 3 and 5 opted for tightly packed binary streams for data exchange. But eventually, XML will become the ubiquitous data format for mobile applications. Throughout this and the following several chapters, we will see several real-world examples that showcase capabilities of mobile XML clients.Chapter 17.Since CDC and PersonalJava have full support of core Java libraries such as IO and String, we can port J2SE and J2EE XML libraries to those platforms or even run compiled J2SE XML libraries directly. Having said that, specially optimized, fast, and lightweight XML parsers are still preferred on the mobile platform.On the CLDC platform, we need specially written lightweight XML parsers. There are several different CLDC-compatible XML parsers available from various commercial and open source projects. In this chapter, we focus on the open source kXML package. For more parsers, please refer to the "Resources" section. CLDC parsers provide only the most basic functionalities, and none of them validates XML messages against document type definitions (DTDs) or schemas.
XML is often considered bandwidth expensive in mobile applications because of the extra tags. There are various ways to minimize the bandwidth impact. In the JXME project (Chapter 9), an XML-like binary format is used for compact data storage; In the WAP world, a standard XML compression scheme called WBXML is widely used. However, neither technology is widely used by enterprise backend applications. |
|