WML » Introduction

Download free PDF version

Welcome to the DevGuru WML Quick Reference guide. This is a unique 62-page reference source for all of the tags and attributes that compose the Wireless Markup Language (WML) version 1.2. This Quick Reference also includes real working code examples that were tested on the M3Gate version 0.4 Wireless Application Protocol (WAP) web browser simulator. (There are several such simulators available for free on the Internet.)

The concept of connecting a wireless (mobile) phone to the Internet has finally gone from being a pipe dream to reality. As a consequence, the technology known as WAP is a very hot topic. WAP is used to create a Gateway that serves as a two-way intermediary connecting path between the Internet and a mobile phone. The Gateway fetches the WML program from the remote server, compiles it, and sends the compiled byte stream to the wireless browser.

This is cutting-edge technology and there are definite limitations. Consider the "simple" HTML language which has been used to create billions of pages on the Internet. In fact, HTML is far too complex of a language to use to display content on a wireless phone viewing screen (constraints include memory size, processing power, and download time). The solution to this problem was to create the Wireless Markup Language in 1999. As a first approximation, WML can be considered to be a highly simplified, bare bones version of HTML, but a more appropriate approximation is that WML is a small language in XML.

WML is designed to allow the static display of text, tables, hyperlinks, monochrome images, and input fields. The individual page is called a card, and a collection of these cards which are linked together is referred to as a deck. There is usually an upper size limit (typically ~1400 bytes compiled) for a card.

Indeed, WML is a small language. It is composed of only 35 tags and associated attributes. Note that 14 of these tags have no analog in HTML 4.01. Two of the attributes, class and id, are available for all tags and serve the same purpose as their counterparts in HTML.

Here are a few rules that must be obeyed. The WML tag and attribute names are always in lower case. Like XML, all WML tags MUST be closed. Self-closing tags end with a space and slash, for example: . An open and closed WML tag is commonly referred to as a WML element. Unlike HTML, there can be no freestanding text. All text must be contained in a valid WML element.

There is a strict hierarchy about which WML elements can be nested (contained) in various other WML elements. Nesting information is provided for each tag. In addition you can view the WML Nesting Hierarchy Tree which displays in a tree diagram the nesting relationship. (This was created using dgTree.)

There is a companion language called WMLScript that can be used to create functions for WML pages. This adds some versatility to WML. Again, as a first approximation, WMLScript is to WML as JavaScript is to HTML. Please refer to the companion DevGuru WMLScript Quick Reference.

You can use other languages, such as Perl and ASP, to generate a WML file.

The Guru hopes that developers will find this Quick Reference to be of value for understanding this new language in a highly evolving and rapidly improving technology.