================================================

Web Design: WML coding

Over the last two issues I have introduced WAP (Wireless Access
Protocol) and WML (Wireless Markup Language). WAP and WML
are the protocol and code necessary to display the equivalent of Web
Pages on a Wireless device such as a cell phone. If you have not had
a chance to read these articles they are available at:  
http://www.imswebtips.com/issue33top1.htm
http://www.imswebtips.com/issue35top1.htm

I realize that some of you are new to HTML design and an
introduction to WML may be a bit premature. Even so, WML is a
closely related technology that is only going to gain in prominence
over the next few years. Whether or not you are ready to try your
hand at WML, a basic knowledge and understanding of how WAP
works is bound to be a benefit to you at some time in the near future.

Coding WML is very similar to coding HTML and in many instances
the tags are the same. WML however, is far stricter in its format than
HTML. Any minor deviation from the standard will cause problems.

The first thing to do is to download a WML simulator. The one I
used is from Nokia. It is free and can be downloaded from:
http://www.forum.nokia.com/developers/wap/wap.html You can also
get one from the Phone.com site at:
http://www.phone.com/products/upsdk.html

The Nokia simulator is a standard HTML text editor that exports to a
simulated cell phone. I have posted a screen shot at:
http://www.imswebtips.com/is36fig1.htm for those of you who have
not yet looked at it. With a little practice you should not have much
trouble learning how to use it. After typing the WML code into the
editor, you can Compile and Show to view the results in the cell
phone simulator.

What does WML look like?

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
<template>
</template>
 <card id="card1" title="Welcome">
   <p>
     <em>
        Welcome to the Virtual Mechanics WAP home-site.
       <br/>
       <i> For all your WAP needs<br/></i>
     </em>
   </p>
 </card>
</wml>

is36fig2

This is the example I used to create the screen shot. The first two
lines are standard in all WML files. For those of you that are familiar
with it, you will note that the first line identifies the WML file as a
form of XML. The second line identifies the version of WML that is
being written.

The main WML code is surrounded by <wml> </wml> tags the same
way that HTML is surrounded by <html> </html> tags. Within the
code are two permissible sections. The first section is <template>
</template> which describes the layout of buttons that are common
to all cards.

The second section contains the cards surrounded by the card tags
<card> </card>. The above example only contains one card but in
fact you can have as many as you like within the deck. Text must be
imbedded with the paragraph tags <p> </p> and can be formatted
with many of the same tags that are used in HTML such as: bold
<b></b>, italic <i></i> and underline <u></u>. Although many tags
are similar to HTML tags, you cannot count on all HTML tags being
available or even identical when they are available.

In WML all tags must be closed. In HTML it is acceptable to have a
single paragraph tag <p> but in WML a paragraph must be closed
with the </p> tag before another <p> tag is used. Failure to do so or
to attempt to enter text outside of a paragraph will cause an error.
When a tag has no logical closing tag, it must be closed within the
tag. The image tag for example, is almost identical to the HTML
equivalent except that it is closed with the tag with a final backslash.
An example is: <img src='mypic.wbmp' alt='My Pic'/>

That's about it as a brief introduction to WML and WAP. Obviously
there is a lot more that you will need to learn and research before you
can be proficient with its use. For more information and links start with:

http://www.waptastic.com
http://www.wapforum.org



================================================
"IMS Web Tips" ISSN 1488-7088
© Copyright
1999-2000 Virtual Mechanics
================================================

"IMS Web Tips" is a weekly news letter for all web site managers regardless of experience who are looking for detailed information on creating, maintaining and promoting their web sites.
Web Engine
For the best in D HTML editors
Click here for a free WYSIWYG pixel precision HTML editor.
IMS WebTips



Home
Archive by Topic
Archive by Date
Virtual Mechanics