|
![]() |
|
Article from February, 1999. XML and the Palm PilotBy Bob DuCharme Bob DuCharme is a senior software engineer at Moody's Investor's Service. He is the author of the brand-new XML: The Annotated Specification, and SGMLCD, a tutorial and user's guide to free SGML software. Both books are part of Prentice Hall's Charles F. Goldfarb Series on Open Information Management. Abstract
The Palm Pilot is a pocet-sized computer that has become much more than its collection of plastic and silicon. In this article, our XML man-on-the-beat explains how a pocket-sized computer gives us the ability to practice what we preach about the utility and functionality of XML. Santa brought me a Palm Pilot for Christmas, and I love it. Like the Macintosh, it deserves credit not for innovating but for assembling formerly experimental technologies into an affordable, well-designed, easy-to-use package. The Palm Pilot combines solid handwriting recognition (as long as you write each letter their way, which is not difficult--I am using it to write this), a simple interface to built-in applications and the ability to add more apps into a six-ounce computer that is ready to use less than a second after you turn it on. And, it runs for months on inexpensive batteries ( AAA) available in any drugstore. What does this have to do with XML? It gives us a chance to practice much of what we have preached. If those of us who have been going on and on about the advantages of portable, non-proprietary data formats can not take advantage of this format on a hot new platform that epitomizes the trend toward convenient, distributed, thin-client computing, then maybe we should pipe down. I know of no XML-aware software that can run right on the Pilot. While there is no Java Virtual Machine available for the Pilot, the Jump program is available to convert Java source files to assembler code that can then be assembled to run on the Pilot; perhaps one of the Java-based XML parsers might work with it. (See http://www.hewgill.com/pilot/jump/jump.htm for more information.) Meanwhile, let us look at the Pilot as a potential input device and output medium. The Palm Pilot as Input DeviceHow hard is it for an XML system to take advantage of data entered into a Palm Pilot? First, a little background: the Palm Pilot is designed to be used in conjunction with software loaded onto a Windows 95/ NT machine or Macintosh. After you plug the included "cradle" into the larger computer's serial port and the Palm Pilot into the cradle, pressing the cradle's "HotSync" button synchronizes the PC and Pilot copies with the most recent data. The PC copy, which you edit and use with the Palm Desktop application included with the Pilot, is stored in a binary, proprietary format. It can export this data into several formats, but none even resembles XML. Some of its applications can export to a comma- or tab-delimited format, but something is lost in the translation--while you can assign multiple fax numbers or multiple home phone numbers to the same address book entry, upon exporting you have to designate one of eight categories (home, fax, beeper, etc.) to each of the five phone numbers that can be assigned to each entry, without assigning the same category to more than number. Of course we all like to think that someday XML will be a choice on the "Export" menu of more and more applications. Until then, what can we do? I tried to write a program that would convert the Pilot's binary archive format to XML, storing all the data in the output version, but I discovered that the hacked spec of the file format that is available at http://ourworld.compuserve.com/homepages/nseessle/frames/pilot/dat_e.htm (the proper spec is not publicly available) was outdated and did not accurately describe the file formats used in version 3.0 of Pilot OS. Utilities to read Palm Pilot data via the HotSync cradle have been written in the Python programming language (available at http://www.concentric.net/~N9mtb/cq ; see the January 1998 issue of <TAG> for more on Python and XML), but I was a little too new to this language to take advantage of code that communicated with external devices. So, it looks like for now I have to copy and paste long stretches of text like this column from the Palm Desktop PC application into an XML editor. To preserve the structure of data from the Pilot's address book, I use a little Perl script (See http://www.snee.com/bob/pp ) to convert the comma-delimited version to XML. The Palm Pilot as Output MediumGoing from XML to a format optimized for the Pilot is much easier. The applications that export comma- and tab-delimited can also import them, and I wrote a little script to convert the XML document where I keep my own address book into a comma-delimited file that the Palm Desktop could import and then HotSync over to my Pilot. A more interesting application is the use of the TealDoc program when using the Pilot as a publishing medium. This shareware application, like several others available, is a viewer for the popular Palm Pilot doc format. Pilot users can use accompanying utilities to convert flat text files to the more efficient doc format and then HotSync them over to the Pilot, and web sites devoted to the platform have growing collections of literature available as doc files. For most doc file readers, every character of text displayed has the same size, font, and text attributes. TealDoc's documentation lists " HTML-like" codes that can identify text to be displayed in four different sizes, bold, and reverse video by the TealDoc application after the text is converted to a doc file. You can embed graphic files created with their TealPaint program, add hypertext links, and add bookmarks accessible from a pop-up menu. Despite the idiocy of some of the markup rules (for example, some "attribute" values won't work unless they are quoted while others won't work when they are quoted) the markup is simple enough that any XML file could be converted using any of the popular conversion tools. The payoff of all of this is seeing that we can now easily convert XML files to formatted hypertext documents viewable on a mass-market output device that fits in a shirt pocket. That is progress. <end/> |


