Proceed to WirelessDevNet Home Page
Publications, e-books, and more! Community Tutorials Store Downloads, tools, & Freebies! IT Career Center News Home
newnav.gif

Newsletters
EMail Address:



   Content
  - Articles
  - Columns
  - Training
  - Library
  - Glossary
 
   Career Center
  - Career Center Home
  - View Jobs
  - Post A Job
  - Resumes/CVs
  - Resource Center
 
   Marketplace
  - Marketplace Home
  - Software Products
  - Wireless Market Data
  - Technical Books
 
   News
  - Daily News
  - Submit News
  - Events Calendar
  - Unsubscribe
  - Delivery Options
 
   Community
  - Discussion Boards
  - Mailing List
  - Mailing List Archives
 
   About Us
  - About WirelessDevNet
  - Wireless Source Disks
  - Partners
  - About MindSites Group
  - Advertising Information
 

The X Factor

by Bryan Morgan

The eXtensible Markup Language (XML) has taken portions of the computing world by storm. Organizations looking to standardize data exchange, facilitate e-commerce, or provide standardized interfaces to enterprise data have aggressively found ways to integrate XML into their business processes. Software tool and application vendors haven't lagged far behind in their support of XML, either. A wide range of products, from WAP to Microsoft Office 2000 to the Oracle 8 database server, have quickly put this technology into the hands of users and developers. In this inaugural article, we'll examine what XML is, why it is important, and how the mobile application developer can make use of it.

Data Definition and Description Using XML

XML is a markup language derived from SGML that has garnered enormous support due its ability to describe data (HTML, meanwhile, is used to describe the display of data - a big difference). While HTML predefines a "canned" set of tags guaranteed to be understood and displayed in a uniform fashion by a Web browser, XML allows the document creator to define any set of tags he or she wishes to. Ths specific set of tags for a document is governed by the Document Type Definition, or DTD. While not required, creating a DTD for your document forces all documents referencing this DTD to comply completely with the definition. An XML parser acts similar to a compiler in that it validates each document against its DTD before opening and parsing the document. Any noncompliance with the DTD will result in errors being generated.

The two most common ways to store data within an XML document are elements and attributes. Elements are structured items within the document that are denoted by opening and closing element tags. Elements can also contain sub-elements as well. Attributes, meanwhile, are generally used to describe an element. As an example, consider the following code snippet:



	Bulls
	Cubs
	White Sox
	Bears
	Blackhawks


In the code above, the City element contains the name and state attributes. Additional elements contained within the City element give information on that city's professional sports teams. An entire data set could be contained within an XML document to describe all of the North American cities who host professional sports teams. To view a sample document such as this, click here! Note that in order to successfully view this document in your Web browser, you will need to be using a Web browser that supports the XML DOM 1.0 (more on this later). At the time of this writing, only Microsoft Internet Explorer 5.0 supported this although Netscape has announced support in their upcoming Navigator 5.0 release.

Examining and Manipulating XML Data

Formatting a set of data with XML is a nice first step, but what do you with it at that point? It turns out that, in addition to the basic XML specification, the W3C has also been very busy providing XML with "complementary" capabilities through a standardized object model, extended hyperlinking, and display definition through style sheets. Let's look at each of these efforts briefly.

Dataset Navigation Using The DOM

Developers will be glad to know that the W3C has also defined an XML object model (known as the Document Object Model, or DOM) that defines the set of objects required to access XML datasets. Implementations of the DOM Level 1 are currently available for a wide range of programming languages including C++, Java, and Visual Basic. Because each XML document begins with one root node and additional nodes "flow" out of that root in a tree-like structure, the DOM presents documents as a hierarchy of Node objects that also implement other interfaces.

These links point to several efforts currently underway to provide XML capabilities to handheld computing platforms.

Ikonodyne Pocket XML - A suite of XML tools for Windows CE
expat Open Source XML Parser Toolkit - C code that can be ported to a variety of platforms
Bluestone XML-Contact - Bluestone XML-Contact runs on Palm devices with an internet connection and allows users to upload and download contact information via XML.
Sun Java and XML Page - Download Sun's Java API for XML Parsing

Contact me if you know of other XML projects for mobile platforms. I'll be happy to update the list above.

Extended Linking Capabilities Via XLL

You are probably very familiar with the concept of linking as used in HTML. The following HTML line:

Wireless Developer Network

defines a link to this site's home page using the tag (also known as the anchor tag). This obviously works well and has been the foundation for the World Wide Web as we currently know it. However, what if you wanted to link to the this paragraph within your document? Without having write access to this file, you would not be able to do it using HTML. The eXtensible Linking Language (XLL) provides a more powerful linking mechanism that supports features such as multiple linking from a single source and the ability to link to a specific location within an XML document tree.

Controlling Document Display Through XSL

It is possible, and very common, to build an application that uses the DOM to walk through an XML tree and generate an HTML document on the fly. (In fact, that is how this site's
Wireless Directory, Books, and Hardware sections are created.) The Extensible Stylesheet Language, or XSL, defines another way for controlling XML display as well. If you are familiar with Cascading Style Sheets (CSS) used to format HTML display, then it is useful to know that XSL builds upon CSS.

XSL actually consists of two parts: an XSL transformation language and a formatting object specification. The transformation language is useful in defining how an XML document is converted to another document (HTML, for instance). The formatting objects defines how XML content should be displayed. Once XSL is fully defined and implemented, it will be possible for viewing software (such as a Web browser) to fully display a document based on the XSL definition. At this point, you may still be wondering what the big deal is. After all, our SportsTeams.xml document is rather simple and the technology doesn't seem exactly revolutionary. The beauty of XML is, in fact, its utter simplicity. While we haven't discussed all of the language features (such as data types, namespaces, and DTD creation), the bottom line is that XML is a straightforward, standardized way to structure and describe data. Instead of focusing only on the language details, I will now discuss how XML can be used by those developing for mobile computing platforms.

Using XML To Simplify Mobile Development

XML holds promise for mobile, handheld applications as well due to their unique requirements. While high-bandwidth wireless communications to handheld devices may be the norm in as little as two years (depending on where you live), the current reality is that these devices are generally used to collect data out "in the field" and asynchronously submit this data at a later time. Even devices with fulltime wireless connections are limited to a low bandwidth environment. Knowing this, we wil delve into some current and future applications of XML that can greatly simplify and standardize the development process for those working on these mobile platforms. The majority of these applications deals with data synchronization and interchange after a mobile device returns from it's "disconnected" state. The final application (Distributed Computing) addresses the use of XML with a connected device. Keep in mind that XML, in this case, has a downside as well due to the additional bandwidth constraints it places upon the client connection. For every piece of data that is interchanged, XML tags must also be sent back and forth which may or may not impact your development decisions. This is yet another tradeoff in the continual give-and-take comparison of functionality, ease-of-use, and performance.

WAP

WAP (the Wireless Application Protocol), and specifically the Wireless Markup Language (or WML), is perhaps the most recognizable of the early applications of XML for handheld devices. While WAP defines an overall application and communication architecture for handheld devices, WML is used to define the actual screen layout of the data. WML builds upon XML and is, in fact, defined by an XML DTD located at:

http://www.wapforum.org/DTD/wml_1.1.xml

WML is an excellent example of how an entirely new language can be defined using XML (recall that the X stands for eXtensible!). For more information on WAP and WML, visit our WAP Tutorials.

Data Serialization

Serialization is the process of saving an object to some type of object store to be retrieved (or deserialized) at some later time. In order to keep object data persistent, languages such as Java support object serialization natively. Other languages do not and Java serialization, for instance, is only accessible from within a Java application. Commercial tools are available that support object persistence for multiple programming languages but these are naturally proprietary in nature. An object serialized using XML in combination with a DTD, however, could be retrieved from an object store using any programming language or object technology. As an example, this would enable open interchange between Java and C++ or COM and CORBA, a vexing problem that many organizations have struggled with for years. Developers building synchronization applications for handheld devices (conduits, for instance) could more easily integrate these devices with existing applications or databases via XML. Submitting this data using XML would standardize the synchronization process and would insulate the synchronization process from changes to back-end applications and databases. Likewise, back-end applications and databases could be modified or upgraded with no modifications to client applications thanks to the XML "buffer" in between them.

Enterprise Integration

Enterprise integration has become a very important topic as organizations seek to integrate their enterprise applications (often stored and run on mainframes) with the Web and/or even handheld devices for employees in the field. Often, this involves screen-scraping (the parsing of data from 3270 screens, for example) or hard-wired logic on middle-tier application servers. Technologies such as message queuing help insulate client applications from back-end processing and XML can help facilitate this process. If you are unfamiliar with message queuing, essentially messages are sent from a client to a middle tier "queue" (a software application that acts as a broker for the messages). These messages are then processed by the appropriate client or server in a synchronous or asynchronous fashion. Formatting these messages with XML provides an extra degree of control and maintainability for application developers. Messaging technology holds great promise for handheld developers due its reliability and asynchronous capabilities. IBM has announced plans to port their MQSeries product to handheld platforms such as Palm and Windows CE and Microsoft has announced plans for a Windows CE MSMQ client. We will be discussing these products in greater detail in the coming months.

Data Interchange

All government and commercial organizations must continually retrieve large amounts of informations from customers and suppliers formatted in many different ways. An entire industry segment (EDI) has arisen to help facilitate this need for data interchange. Naturally, in this environment, XML has already been rapidly accepted since it allows an organization to specify within a DTD exactly how they would like all data formatted. Streams of data from a large number of sources all can be accessed in a unified manner thanks to XML. One can imagine a day not far into the future where handheld devices intercommunicate on a large scale via XML data interchange as well. XML schemas defined for store item information (description, vendor, price, etc.) could be retrieved and processed by your computing device as you walk through a mall or store in order for your digital assistant to help you locate exactly what you are looking for.

Distributed Computing

On the Web, it is very common to call a CGI script (or ASP or servlet) to perform some operation and return a new page formatted with the appropriate data. However, there is no open, standardized way to call methods on servers and return structured data. In addition, if you have done much client/server development, you have no doubt come into contact with remote method calls and data retrieval via RPCs or the two leading distributed object standards: DCOM and CORBA. While it is possible for a DCOM object to instantiate a CORBA object, or vice versa, it is not a painless process. Opening this type of operation up to the Web becomes a near impossibility thanks to platform, programming language, and firewall restrictions. Java RMI solves many of these problems but, as you're probably well aware, every application isn't written in Java!

If only there were a simple technology that sat atop HTTP and TCP/IP that allowed remote clients to perform object method invocations and data retrieval in a structured manner. This would essentially open an entire Web of programmable servers! Instead of a host of Company X servers providing stock quotes on their pages, your server could instead pass requests to the Company X servers and retrieve XML-formatted data back for your own uses! This becomes especially useful for sites interested in syndicating content or data. Want a site's latest sports scores, weekly columns, or human resources information? Fire off a request over HTTP and parse the XML data that is retrieved.

As you may have guessed by now, one technology has been announced that makes this type of development a reality. XML-RPC, developed by Userland Software and Microsoft, is a distributed computing technology that accomplishes what no other technology has been able to. It is lightweight, programming language independent, supports interoperation of remote servers, and will run over any firewall. Microsoft has taken XML-RPC a step further by defining the SOAP (Simple Object Access Protocol) Specification and submitting it to the IETF. SOAP essentially works by a client formatting a method call with arguments in XML and submitting this request to a server via HTTP. The server then processes the request and returns data formatted as XML back to the client. The following is a sample SOAP request:



 
 
 12345
 
 


This SOAP request calls the GetSalaryInfo() method on a server in compliance with the SOAP specification. Sample output from the server might look like this:



 
 
		U.S. Dollars
 64,256
 
 


As you might guess, this response says that Employee 12345 has a salary of 64,256 U.S. Dollars per year.

For more information on SOAP, visit the SOAP FAQ. This specification makes distributed computing a reality for wireless developers interested in accessing corporate RPC, DCOM, or CORBA servers but whose device requirements prevent the installation and overhead of running full-fledged object request brokers (ORBs) on the handheld unit. Currently, SOAP support has been announced by a number of vendors, including Iona, UserLand, and Rogue Wave. While there is still much work to be done (server introspection capabilities will be required as will a standardized method for rewarding sites that open up their server capabilities to SOAP), technologies such as XML with SOAP promise to take the Web from its simple, "flat" architecture consisting of an incredible number of opaque pages and scripts to a new paradigm where data is structured and servers are open for use by a variety of clients.

Summary

XML is often mentioned together with terms such as lingua franca, holy grail, and glue because it offers the hope of standardized data interchange. It also facilitates advanced data display capabilities and promises to add additional intelligence and capabilities to the Web as it currently exists. Technologies such as WAP and SOAP promise to revolutionize mobile computing as well through the use of XML. Hopefully having learned lessons from HTML, XML vendors will hopefully decide to stick with the standards this time and not use this technology as yet another marketing tool in the game of technological one-upsmanship. Stay tuned!

About The Author

Bryan Morgan is the founder and editor of the Wireless Developer Network. He has a bachelor's degree in electrical engineering and has worked as a software developer for nine years involved with a wide variety of client/server and Web technologies. His work as a freelance writer and editor has included projects for JavaWorld, DBMS Magazine, Dr. Dobb's Programming Journal, MacMillan Publishing, and Addison-Wesley Publishing. He can be reached at bryan@wirelessdevnet.com.

Other Resources

Books

See our XML Books page for recommended books that can be ordered directly from Amazon.com.

Links

XML.com
The World Wide Web Consortium XML Page
XML and the Second-Generation Web
XML-RPC.com
Microsoft SOAP Specification
IBM Pervasive Computing

Sponsors

Search

Eliminate irrelevant hits with our industry-specific search engine!









Wireless Developer Network - A MindSites Group Trade Community
Copyright© 2000-2010 MindSites Group / Privacy Policy
Send Comments to:
feedback@wirelessdevnet.com