WML: An Introduction - Deal 'Em, Baby!
(Page 2 of 6 )
We’ll start by building a simple deck of cards. Remember, a deck is simply a group of WML cards. It’s that simple.
<?xml version="1.0"? >
<!DOCTYPE wml PUBLIC "-//OPENWAVE.COM//DTD WML 1.3//EN" "http://www.openwave.com/dtd/wml13.dtd"></p>
<p> </p>
<p><!-- WML file created by the Openwave SDK -->
</p>
<p><wml>
<card title="Home Card" id="home">
<big>Our First Card</big>
<p>Welcome to our first WAP-enabled page. We're using WML1.3 to construct this deck of cards!</p>
<p>Here's a
</card>
</wml>
In the example above, we created a simple single-card deck that, when executed, will display a welcome message to our device. As you can see, WML is very similar to HTML – most WML tags are derived from HTML. We open our document with an XML declaration, followed by the location to the DTD we’ll be modeling our page after. If you’re unfamiliar with XML documents and/or DTDs, feel free to read one of our XML tutorials. Next, we open our deck using the <wml> tag. To create our card, we use the <card> tag, and simply make use of a couple of HTML tags, including the <big> tag to increase the font size, as well as our standard paragraph (<p>) tag.
Here’s what the output would look like:

In case you’re wondering what type of cell phone I’m using, I’ll take this time to introduce a development environment suited for WML: Openwave SDK. Openwave is a company providing open software products and services for the mobile market. Here’s a snip from their website:
"Openwave products include phone software, multimedia messaging, Email, location, device management and mobile gateways. As one of the foremost innovators and market leaders in the mobile field, Openwave has gained worldwide experience and deep industry expertise.
"Openwave leverages that expertise through a set of strategic and operational services. Our broad product portfolio and industry experience combine to make operators and device manufacturers successful by improving the end user experience."
Openwave SDK is a free download and is a great tool for developing WML-based sites. The SDK comes with various emulators, each with their own set of features, allowing you to test your sites on various phones.
Next: Shuffle That Deck >>
More Web Services Articles
More By Frank Manno