Read our list of questions and answers on Java XML
Here is part 1 of a 4-part chapter excerpt from the book Java XML Programmers Reference by Mohammad Akif, Steven Brodhead, Andrei Cioroianu, James Hart, Eric Jung and Dave Writz; ISBN 1861005202; published July 2001, 750 pages.
Our series takes a look at Chapter 11: XML Tools for Information Appliances.
This chapter focuses on Java, XML, and XSLT technologies for lightweight clients.
Lightweight clients are defined as those with more limited resources than traditional
clients. The term information appliance is used interchangeably with lightweight
client. The obvious devices that fit within this category are personal digital
assistants (PDAs), mobile phones, and pagers. However, many other embedded devices
and consumer electronics may fit into this category: television set-top boxes,
global positioning system (GPS) receivers, thermostats, watches, digital cameras,
even Internet appliances such as kitchen stoves, refrigerators, and radios.
Non-consumer-oriented devices also can fit in this category, such as industrial
automation and control sensors.
However, this definition is not limited to non-PC devices. Any environment
that requires the following should qualify:
A small memory footprint
Limited CPU overhead or availability
Restricted network bandwidth
Applets, in a typical browser, also fit this
lightweight category. As we shall see, XML generation, parsing and transformation
are just as important for these types of clients as they are for thin clients
(browsers) and servers.
In this chapter, we will address three key Java
XML technologies for lightweight clients:
Lightweight parsers and document generators
– Reference material for three parsers and document
generators. Through examples, we will demonstrate the usage of three lightweight
XML parsers, two of which can also generate documents by enabling you to create
a DOM-style node tree.
XSLT compiler – a Java tool that creates fast and lightweight
Java class files for transforming XML given an XSL stylesheet
CLDC (Connected Limited Device Configuration) and the Java KVM (Kilobyte
Virtual Machine) – a Java specification for limited devices, which
includes a reference implementation written by Sun. The Java KVM, a virtual
machine redesigned for the constraints of limited devices, is part of that implementation.
We can do the same essential processing, parsing, and transforming tasks with
these tools that we have used elsewhere in the book. Examples in the chapter
will show how to work around some of the limitations of these tools, and how
we can leverage their small size to get them to run on devices that would not
support their heavyweight counterparts.
There are a number of acronyms and
terms you'll encounter in the following sections, so let's briefly cover some
terminology before we continue:
Term
Definition
CDC
Connected Device Configuration
– defines a base set of I/O, connectivity, and other classes for
"heavy" lightweight clients such as set-top boxes and audio/visual
equipment
CLDC
Connected Limited Device
Configuration – defines a base set of I/O, connectivity, and other
classes for lightweight clients such as pagers
J2ME
Java2 Platform, Micro Edition
– the Java2 platform for information appliances (lightweight clients)
Java KVM
Java Kilobyte Virtual
Machine – a Java virtual machine designed to minimize its memory
footprint instead of maximizing its speed. Currently ported and compiled for
Linux, Solaris, Windows, and Palm OS
PDA
Personal Digital Assistant
– a digital organizer, consisting of applications such as an address
book, date book, and notepad
This chapter starts by discussing why we should consider
using XML on lightweight clients. We introduce the Java 2 Platform, Micro
Edition (J2ME) and its architecture. Then, we cover three lightweight XML
parsers and the XSLT Compiler. Finally, we conclude with a Palm OS application
that beams address book entries in XML format from one Palm device to another using
the Java KVM.
Any discussion of using XML on lightweight clients typically
leads to solutions that do not adhere well to standards. W3C XML-related
recommendations and standards usually don't have lightweight clients in mind,
as they are written independently of any platform or operating system. The
implementation of these recommendations often involves resource-intensive
processing not possible on lightweight clients. Therefore, many W3C
recommendations, for instance namespaces and DOM, are not supported, in order
to keep library sizes down.
Instead of looking at the XML components covered in this
chapter as non-standard, I encourage you to view them as you might have viewed
tools of the early World Wide Web: useful, but non-standard and non-standardized. This will change with time, as we can see by the recent conglomeration of multiple lightweight Java initiatives into the far-reaching J2ME.
REPORTS
Analyize In-Line NAC strategies and products.
ANALYTICS Plan and design your enterprise blade server deployments
InformationWeek U.S. IT Salary Survey 2008
Salaries for business technology professionals are falling. Here's what you need to know in order to make good hiring decisions and personal career choices. Purchase Today: $299