Wap/WML : First WML Page
Contents ]
Jean-Michel Blanchard

Structure of a WML Deck

WML decks rely on a fixed structure composed of several sections called cards. These cards correspond to the different topics of a deck, and you can easily browse through them by using their titles. They behave like the anchors of a HTML document.

A card is declared as follows:

<wml>
<card id="mycard" title="Title">
<p>
my text
</p>
</card>
</wml>

The content of each card is enclosed between the <card> and </card> tags. Two attributes can be associated with the card introducing element:

  • id, to identify the card.

  • title, to specify a title that will be displayed on screen.

  • The second attribute is optional. Certain webmasters omit it to save space on phone displays.

Be concise! When you write a title on a card, or a WML document section, use brief headings. Don't forget that they will be read on the small display screen of mobile devices.

It is then possible to create a page containing only a title:

<?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="mycard1" title="Home">
<p>
</p>
</card>
</wml>

This card is identified by the mycard1 string. The title that is displayed at the top of the screen is introduced by the title attribute.



Figure 1: Your very first WML page

You can include as many cards as you like, provided they are all assigned a unique id. But whatever the situation, it is always the first card of the deck that is displayed first on the device screen when the deck is forwarded.

Narrow band access. The WAP throughput capacity cannot be compared with the one you are familiar with on your computer. The downloading times are long and expensive, and having additional cards in a deck also makes for a slowing-down factor.



  1   2   3   4 
Content