WAP WML Syntax - WAP

Explain briefly about the WML syntax in WAP applications

WAE, Wireless Application Environment constitutes the top layer of the WAP architecture. WAE consist of WML and WML scripting language.

The applications which are sent through the wireless devices such as mobile phones are designed using the WML scripting language. The intricacies related to small screen and the low bandwidth of transmission is taken care by this language. The XML application that is defined in document-type definition is WML.

WML pages are called as decks which are constructed in the form of set of cards, using links which are connected to each other. When a mobile phone is used to access the WML page, the cards in the page are downloaded from the WAP server to mobile phone by displaying the content.

To display the content and navigate between the cards, WML commands and syntaxes are used. The variables, format text are declared by the developers using these commands and the images are displayed on the mobile phones.

Describe the structure of WAP Program

The WML program is basically divided into two parts – the document prolog and the body. For instance, consider the following code:

The first line of the code mentions that it is an XML document and the version of the document is 1.0. The second line provides the URL of the document type definition (DTD) and selects the document type, the full XML definition of the WML is provided by this DTD. The prolog is generated automatically by th tool kits if the header is copied exactly.

The body is enclosed within a <wml>...</wml> tag pair as shown above. The body of a WML document can consist of one or more of the following:

  • Deck
  • Card
  • Content to be shown
  • Navigation instructions

What are the different WML Commands used for WAP?

The commands used in WML are summarized as follows:

Formatting

Command
Description
<p>
Paragraph
<b>
Bold
<big>
Large
<em>
Emphasized
<I>
Italicized
<small>
Small
<strong>
Strongly Emphasized
<u>
Underlined
<br>
Line Break

Inserting images

Using Tables

Command
Description
<table>
Definition of a table
<tr>
Defining a row
<td>
Defining a column
<Thead>
Table header

Variables

The variables are declared as:

The variables are used as:

Forms

Command
Description
<select>
Define single or multiple list
<input>
Input from user
<option>
Defines an option in a selectable list
<fieldset>
Defines a set of input fields
<optgroup>
Defines an option group in a selectable list

Task Elements

Command
Description
<go>
Represents the action of switching to a new card
<noop>
Says that nothing should be done
<prev>
Represents the action of going back to the previous card
<refresh>
Refreshes some specified card variables.

Events

The various events are as follows:

Command
Description
<do>
Defines a do event handler
<onevent>
Defines an onevent event handler
<postfield>
Defines a postfield event handler
<ontimer>
Defines an ontimer event handler
<onenterforward>
Defines an onenterforward handler
<onenterbackward>
Defines an onenterbackward handler
<onpick>
Defines an onpick event handler

Sample WML Program

The following provided WML code is kept into info.wml on the server. Any WAP device can be used for accessing the page, if the server is WAP enabled.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WAP Topics