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:


Strongly Emphasized
Line Break

Inserting images

Using Tables

Definition of a table
Defining a row
Defining a column
Table header


The variables are declared as:

The variables are used as:


Define single or multiple list
Input from user
Defines an option in a selectable list
Defines a set of input fields
Defines an option group in a selectable list

Task Elements

Represents the action of switching to a new card
Says that nothing should be done
Represents the action of going back to the previous card
Refreshes some specified card variables.


The various events are as follows:

Defines a do event handler
Defines an onevent event handler
Defines a postfield event handler
Defines an ontimer event handler
Defines an onenterforward handler
Defines an onenterbackward handler
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