dcsimg

WML Page 3

By Aaron Weiss (Send Email)
Posted Jul 16, 2000


"And so as wireless begat WAP, WAP in turn begat WML ...", as they might have said in Biblical times had they been writing about content delivery over wireless networks. The Wireless Markup Language, WML, will strike a familiar chord to anyone who has ever worked with the HTML behind most Web pages. In fact, WML is a specific implementation of XML, defining a markup syntax and structure with which users can design pages suitable for a small device.

HTML and WML operate on slightly different underlying metaphors. Whereas HTML is premised on the now-ubiquitous "page" metaphor, WML rests on a "deck of cards" metaphor. Typically, an HTML document represents a single Web page, but a WML document represents a deck within which there can be one or more cards. Navigation within the deck consists primarily of flipping between cards in the deck, either in sequence or via hyperlinks.

Remember that the driving force behind WML is that a wireless device has a small, often tiny, screen and cannot display very much information -- sometimes as little as four or five lines of text. Thus, there's no real space for graphics other than the occasional small logo, most text is the same size, and the screen is often monochrome. So, the real strength in wireless networking is not the capability to replicate land-based Web surfing on the street or in the air, but to target small, focused pieces of data, such as a weather report, a sports score, or a travel reservation.

Like HTML, a WML document is a text document when created as source code. Although this is not a WML tutorial, per se, let's look at a simple WML deck of cards, to get a feel for the type of data that Apache will deliver to wireless devices. We'll set up a WML deck with two cards: the first with a greeting and a link to the second card, the second with some very fictitious "favorite WML pages".

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
 <wml>
  <template>
   <do type="back" label="Back">
    <prev/>
   </do>
  </template>
  
  <card id="main" title="Welcome to my WAP">
   <p align="center">I can't say much, since this screen is tiny.<br/>
   Why don't you visit my <a href="#fave">favorite WAP links.</a></p>
  </card>
  <card id="fave" title="Favorite WAP Links">
   <p align="center">These are some WAP sites I would love, if they existed.</p>
   <p align="left">
<a href="wap.cats.com">Tiny cat pictures</a><br/> <a href="wap.weather.com">The weather</a><br/> <a href="wap.jellybeans.org">One click jelly bean ordering</a> </p> </card> </wml>

Although not identical to HTML, the WML syntax above does have a certain familiarity about it. Had we viewed the above WML page on an actual phone, delivered by, say, a properly configured Apache server, the results might look something like this:



Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.