After XML and document type declaration WML deck start
with <wml> and ends with </wml> tags. Each
deck may contain one or more cards. First card of WML
page is displayed by the cellular device and this card
provides the links to the other cards of the deck.
|
<wml>
<card
id="Card1" title="Learning WML ">
<p>
Welcome
to Unwired World!
</p>
</card>
</wml>
|
WML card starts with <card>and ends with
</card> tag. Attribute "id" of card
element gives the identity to the card and using this id
we can refer any card in the WML page. Next is <p>
tag which we are using to display the paragraph. We can
use <p>, <b>, <i>, <br>,
<a> in our programming and these tags are
identical to the HTML tags.
| Tags |
Functionality |
| <p> |
Writing paragraph |
| <b> |
Writing bold text |
| <i> |
Writing italic text |
| <br> |
Inserts a line break |
| <a> |
Creates a link |
By
the end of this chapter you are very much familiar with
the WML language. Now try the follwing WML script which
uses the different formating tags. You can test your
script by copying and pasting the code in above text
area and pressing the test button.
|
<?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="Card1" title="Learning WML ">
<p>
Welcome
to Unwired World! <br/> Line break<br/>
<b>This
is bold.</b><br/>
<i>This is italic.</i><br/>
<b>This is bold.</b><br/>
<u>This is underline.</u><br/>
<small>This is small.</small><br/>
<strong>This is strong.</strong><br/>
</p>
</card>
</wml>
|
Now write your own scripts and test it.
In the next section you will learn how to write more
than one cards in a deck and define the navigational
links between them.
|