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.
WML
Document Structure
Hello
World WML Example
Let's
take a look at our first WML example. It shows the structure of a
typical WML document.
(helloWorldEg1.wml)
<?xml
version="1.0"?> <!DOCTYPE wml PUBLIC
"-//WAPFORUM//DTD WML 1.3//EN"
"http://www.wapforum.org/DTD/wml13.dtd">
<wml> <card
id="card1" title="WML Tutorial"> <p>Hello
World</p> </card>
<card
id="card2" title="WML Tutorial"> <p>Welcome
to the world of WML</p> </card> </wml>
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.
|
Feedback Form (ExpandCollapse)
|
|