Introduction to WML

WML (Wireless Markup Language) is a markup language based on XML. Technically it is an XML application.  Just like HTML and XML, WML is read and interpreted by a browser built into the WAP device. For WAP devices, the browser is commonly called a micro browser, indicating that its capabilities are somewhat limited. Additional limitations may be the result of the device that the micro browser runs on. If you have no prior knowledge of XML, you will probably find WML much more stringent than HTML.

 

WML files are referred to as "decks". Each deck consists of one or more cards. Cards begin and end with <card> tags, while decks begin and end with <deck> tags. When the WML micro browser accesses a WML document (or deck), it reads the whole deck.  Therefore, it doesn't need to load any more data to navigate between cards. The <card> tag in WML is very similar to the <a name> tag of HTML.

 

WAP devices have very little memory, so there is a limit to how big each WML deck can be. The limit varies a great deal from one browser to another. These limits refer to the compiled form of your deck, which is usually fairly small compared to the plain text XML code that you send out from the server.

 

 

Example:

<?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="Card 1">

  <p>

Hello World!

</p>

 </card>

 <card id="card2" title="Card 2">

  <p>

Hello World!

</p>

 </card>

</wml>