Upcoming Events

Cloud Connect
Santa Clara
Feb 13-16, 2012

Cloud Connect brings together the entire cloud eco-system to better understand the transformation we're experiencing and promises to be the defining event of the cloud computing industry. Learn about the latest cloud technologies and platforms from thought leaders in Cloud Connect’s comprehensive conference.

Register Now!

More Events »

Subscribe to Newsletter

  • Keep up with all of the latest news and analysis on the fast-moving IT industry with Network Computing newsletters.
Sign Up
Business Applications
W O R K S H O P  
WML Takes XML on the Road

  March 19, 2001
  By Ahmad Abualsamid



WML: The Language

Back to the syntax of WML. I mentioned that it is an XML application, thus all WML documents should start with a variation of the following line:

<?xml version="1.0"?>

Anything else, even a white space before the opening bracket, would cause an error. Next, the DTD (Document Type Definition) must be referenced. Here's how a minimal "Hello World" WML application would be written:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="mycard" title="My first card">
<p>Hello world!</p>
</card>
</wml>

The first line indicates an XML application; the second references the DTD. All WML documents are enclosed by the <wml> </wml> tag pair. This would define a WML deck. Cards are then defined within the deck by specifying the tag pair. But be careful -- wireless devices have built-in limits on the size of a deck. Although these vary by device, a good bet is to limit the size of the compiled deck to 1,397 bytes. That is the most that can be handled by the Nokia 7110, which is one of the most popular WAP phones, according to the WAP FAQ, available at: www.wap.com/cgi-bin/wapfaq.cgi?chapter=0.

More complex WML documents can include black-and-white images. These images have their own new graphic format, WBMP (Wireless BMP). When this format was first introduced, developers had to edit binary BMP files and change the header bytes to convert the file into WBMP format. Now, there are several WBMP editors, as well as tools, that convert from other file formats. For example, the Nokia WAP SDK has a WBMP editor along with everything you need to develop WML content.

When it comes to graphics on wireless devices, however, being stingy is a virtue. Graphics generally don't look good on small screens. And while there are devices with screens large enough to display images attractively, WBMPs also devour precious -- and pricey -- bandwidth. The Wap.com site recommends that WBMPs not be wider than 96 pixels and higher than 48 pixels at 72 dpi.

More information about WML can be found at Wap.com. A WAP FAQ, which covers WML and has many pointers to useful resources, is at www.wap.com/cgi-bin/wapfaq.cgi?chapter=0. The WAP Forum Web page, available at www.wapforum.org, is a must for any WAP/WML developer, and Waplinks.com provides lots of useful links. Finally, leading mobile phone companies, such as Nokia and Phone.com (now combined with Software.com to make Openwave Systems, at www.openwave.com), have lots of resources, especially if you are looking for SDKs to enable development of WML content without having to buy the wireless devices. The Nokia SDK, found at www.forum.nokia.com/main/1,6668,1_1,00.html, includes simulators, editors and lots of samples. The Phone.com kit is available at http://developer.phone.com and requires registration.

Another piece of software that could prove extremely useful is WinWAP, a WAP browser for Windows that you can use to browse WAP sites as well as WML files on your local hard disk. A free 30-day evaluation version of WinWAP can be downloaded at www.winwap.org.

Existing Web Content and WAP

As the world goes wireless, the task of making your existing Web content available to wireless users becomes more compelling. This is not a project to be undertaken lightly, however. Good planning is required before you embark. There are three basic techniques that can be used to convert content. The first is to copy your existing data and rewrite it in WML. If you have a small Web site with mostly static information, then this is the fastest and least costly path.

A more expensive technique would be to use middleware, either commercial or developed in-house, that takes your existing HTML content and reformats it on the fly, customized for the requesting client. For WAP clients, the application can generate WML based on your current HTML content. This is an error-prone process and can be quite costly, even if you develop the middleware in house. A few commercial offerings exist, such as IBM's WebSphere Transcoding Publisher, but they are neither error free nor inexpensive -- IBM's offering lists for $30,000 per processor. A good article on the subject can be found at www.wap.com/share/osas/cache/artid150206.html.

The last technique, which makes the most sense to me, is to write your content from the start in XML (and rewrite your existing content in XML). I would also push most of the content into a database and let my application server generate the XML documents out of the database, but that's a different story.

Once you have developed the XML content, you can have several XSL (Extensible Stylesheet Language) style sheets that format the content to correspond to the target client. Developing an XSL style sheet is not the simplest of processes, but it only needs to be done once per target client. After you have an XSL sheet for WAP, Internet Explorer, Netscape and Opera, for a start, you can use the appropriate style sheet to format your XML content. You will never again have to write content for different browsers -- a goal worth pursuing.


   Page: 1 | 2 | 3 | 4 | Next Page

Research and Reports

Hypervisor Derby
August 2011

Network Computing: August 2011

TechWeb Careers