Page 62 - DCAP512_WAP_AND_WML
P. 62
WAP & WML
Notes 5.3 Building Decks of Cards
WML pages are often called “decks”. A deck contains a set of cards. A card element can contain
text, markup, links, input-fields, tasks, images and more. Cards can be related to each other with
links.
When a WML page is accessed from a mobile phone, all the cards in the page are downloaded
from the WAP server. Navigation between the cards is done by the phone computer - inside the
phone - without any extra access trips to the server:
<?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="no1" title="Card 1">
<p>Hello World!</p>
</card>
<card id="no2" title="Card 2">
<p>Welcome to our WAP Tutorial!</p>
</card>
</wml>
The result MIGHT look like this in your mobile phone display (note that only one card is
displayed at a time):
——— Card 1 ———
Hello World!
Card
It is a single unit of WML navigation, which often directs to one screen of viewed content but
could work on a step that is not displayed.
Deck
Some important points about a deck are highlighted below.
It is analogous to an HTML page in that it is the unit of content transmission.
Decks are to WML identical as documents are to HTML.
WML decks are XML documents.
Decks send requests for services and/or to be carried out on servers.
Decks comprises of component known as “cards”.
Each deck must have at least one card.
The device browser accesses and open a deck and reads the cards within the deck. Navigation
traverses from card within a deck. Once loaded, the deck resides in device’s memory.
Each deck starts with the <wml> tag and ends with the </wml> tag. Within these decks, every
card starts with the <card> tag and ends with the </card> tag.
56 LOVELY PROFESSIONAL UNIVERSITY