What Is WML?

Wireless Markup Language (WML) is a markup language used for describing the structure of documents to be delivered to wireless devices. WML is to wireless browsers as HTML is to a browser on a desktop computer. WML was created to address the display, bandwidth, and memory limitations of mobile and wireless devices, such as cellular phones and wireless handheld computers. Because it was designed to run on a variety of devices, WML assumes very little about the device running the application and provides much less control over output formats than you might be used to with HTML.

WML's Origins

In the early 1990s, Unwired Planet created HDML (Handheld Device Markup Language) to serve as the development standard for wireless applications. By June 1997, Unwired Planet had changed its name to Phone.com and, along with Nokia, Motorola, and Ericsson, launched the WAP Forum—a nonprofit organization dedicated to the development and proliferation of a single standard protocol for wireless applications. Using Phone.com's HDML as the basis for its own standard markup language, the forum created and distributed WML—a language different from, but in many respects similar to, HDML. The WAP Forum and detailed specifications for WML can be found on the Web at http://www.wapforum.org/.

Note

WML is similar to HTML, but Web developers will find WML less forgiving and more strict when it comes to syntax.


Although WML will certainly look familiar to Web developers accustomed to HTML, the two languages are really more like cousins than brothers. SGML (Standardized Generalized Markup Language) can really be thought of as the father of both HTML and XML (Extensible Markup Language). HTML is designed to handle a lot of objects, pictures, and other multimedia, which makes it too bulky for the bandwidth limitations of current mobile devices; therefore, HTML was rejected as the basis for WML, which needs a simple architecture that structures data to aid the parsing of a document. That need, and the desire for a language that would survive the demands and fluctuations of turbulent standardization discussions, was the reason that WML was based on XML. By using XML as a base, WML was designed to be a lightweight protocol that would meet bandwidth limitations of existing mobile devices.

WML's Functionality

WML supports six key areas:

  • Text presentation and layout— Although specific devices and WML browsers vary in their output of WML code (very much like output differences between Netscape Navigator and Internet Explorer), line breaks, text formatting, and alignment are all supported by WML.

  • Images— Although WAP-compliant devices are not required to support images, WML supports the Wireless Bitmap (WBMP) image format and image alignment on the screen. Wireless Bitmap is a graphic format created by the WAP Forum which is optimized for mobile devices.

    ▸ For more on using images in WML, see Chapter 6, "Using Images."

  • User input— WML supports choice lists, multilevel choice lists, text entry, and task controls.

  • Card and deck organization— User interactions are divided into cards, and navigation occurs between cards. Decks are related sets of cards which constitute a single file, like a single HTML file. In HTML, viewing one page is akin to viewing one card in WML. However, instead of each HTML page constituting one HTML file, multiple WML cards constitute one WML deck, which is then saved as a single file.

  • Navigation— WAP supports the standard Internet URL naming scheme and anchored links, allowing navigation between cards in a deck, between decks, or between other resources on the network.

  • State and context management— To maximize network resources, WAP allows for variables to be passed between WML files. Instead of sending a complete string, variables can be sent and substituted at runtime. The user agent can cache both variables and WML files, minimizing cache hits and server requests. It is also possible to pass variables between different cards in the same deck; this is an important way to minimize network usage.

Similarity to HTML and XML

If you are already familiar with HTML, SGML, or XML, you should recognize WML syntax, which is based on XML but is more formally defined than a general XML application.

If you are accustomed to developing in HTML, several key differences in WML will take some getting used to. Most fundamentally, the target screen for your application is severely limited and yet variable. Current WAP-compliant devices have display screens that range from sub-VGA graphics to text-only displays with four lines and a maximum of 32 characters per line. Second, the multiplicity of devices running these applications makes it hard for developers to know exactly how their application will appear to any given user. WML developers are not dealing simply with two browsers, as HTML developers typically do, but with dozens and dozens of devices—each with a unique screen and interface. WML also introduces new kinds of functionality on the browser side. WML already provides for several complex actions that would traditionally be coded into your application with a scripting language.

Finally, WML is less forgiving than HTML in several ways: Most obviously, it does not compensate for incorrectly nested tags or uppercase usage.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.5.239