2. WML Deck and Card

A major difference between HTML and WML is that the basic unit of navigation in HTML is a page, while that in WML is a card. A WML file can contain multiple cards and they form a deck. When a user goes to a WAP site, the mobile browser loads a WML file that contains a deck of cards from the server. Only one card will be shown on the screen of the wireless device each time. If the user goes to another card of the same deck, the mobile browser does not have to send any requests to the server since the file that contains the deck is already stored in the wireless device.

WML is designed in this way because wireless devices have a high latency for connecting to the server. Downloading a deck of cards at a time can lower the number of round trips to the server.

You can put links, text, images, input fields, option boxes and many other elements in a card.

3. WML Document Structure

3.1. Hello World WML Example

Let's take a look at our first WML example. It shows the structure of a typical WML document.


<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">

  <card id="card1" title="WML Tutorial">
    <p>Hello World</p>

  <card id="card2" title="WML Tutorial">
    <p>Welcome to the world of WML</p>

The result of the "Hello World" WML example in mobile phone emulators is shown below:

Sony Ericsson T610

Sony Ericsson T68i

Nokia Mobile Browser 4.0

In the following sections, we will describe the elements used in the above WML example.

Previous Page Page 2 of 50 Next Page

Feedback Form (ExpandCollapse)

What do you think about this web page?

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page