WML is an attempt to bring the basics of HTML to mobile phones by using WAP.

WML is based around the concept of a deck of cards as opposed to flat files. One WML page will usually contain many cards.

An example of a WML deck :


<?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="card_a" title="Card A">
    <p><b>Card A</b></p>
    <p>Link to <a href="#card_b">Card B</a></p>
  </card>
  <card id="card_b" title="Card B">
    <p><b>Card B</b></p>
    <p>Link to <a href="#card_a">Card A</a></p>
  </card>
</wml>

WML provides only the most basic formatting tags since the pages must be capable of being rendered on very low-resolution screens e.g. 16x2 character phone screens.

When sent to mobile devices WML code is compiled into bytecode. This has the effect of reducing the size of the code by 2 or 3 times. This is especially good since many small WAP devices can only handle WML decks of around 1500 bytes.

WML has an associated scripting language WMLScript.