WML
WML
(WML)
Sujata Mishra
Regd. No – 04/004
Electronics & Tele- Comm. Engg.
Outlines
Introduction
WML vs. HTML
Basic Features of WML
WML Deck and Card
An Example of WML Document
Structure of a WML Document
WML : Tables
WML : Image
Linking Cards
Navigation
WML Generic Metadata :<meta>
Advantages of WML
Limitations of WML
Conclusion
References
Sujata Mishra 2
Introduction
What is WML ?
WML is a markup language based on XML for wireless
devices.
Sujata Mishra 4
Basic Features of WML
WML includes four major functional areas:
Text presentation and layout -includes text and image
A WML file can contain multiple cards and they are grouped
to form a deck.
Sujata Mishra 8
WML : Prolog
Prolog is the first structural element that is present in
the WML document.
Every WML document starts with the prolog.
Usually divided into a XML declaration and
a DOCTYPE declaration.
The prolog components are not WML elements and
they should not be closed with />.
Example:
<?xml version="1.0"?>
Sujata Mishra 9
XML Declaration
All WML documents are XML documents. So, there is an
XML declaration at the start.
The XML declaration specifies the XML version of the
document.
The character encoding of the document can also be specified
Like,
<?xml version="1.0" encoding="UTF-8"?>
Sujata Mishra 10
DOCTYPE Declaration
All WML documents must have the DOCTYPE declaration.
Placed between the XML declaration and the <wml> element.
Sujata Mishra 11
WML : Elements
Elements are most common form of markup.
WML elements must contain a start tag and a
matching end tag prefixed by a slash.
<city> Kharagpur </city>
Empty elements can be written as <city/> instead of both
tags without contents.
WML is case-sensitive. Elements are all in lowercase.
Element naming convention:
Must begin with an underscore or letter.
Can contain letters, digits, underscore, hyphen, and
periods.
Sujata Mishra 12
Sujata Mishra 13
WML : Elements & Attributes
<wml> Element
<wml> is the root element of WML.
All other elements should be enclosed within the
<wml></wml> tags.
Sujata Mishra 17
Attributes of <p>
Attributes Description
align used to change the horizontal alignment of a paragraph.
• left
• center
• right
Sujata Mishra 18
<wml>
<card id="card1" title="WML Tutorial">
<p align="center">Hello world. Welcome to our WML tutorial.</p>
</card>
</wml>
Sujata Mishra 19
<wml>
<card id="card1" title="WML Tutorial">
<p mode="nowrap">Hello world. Welcome to our WML
tutorial.</p>
<p mode="wrap">You can learn how to build your own WML site in
this tutorial.</p>
</card>
</wml>
Sujata Mishra 20
WML : Entity References
They are used to reference data that is not directly in the
structure.
Sujata Mishra 22
WML : Line Breaking
<br/> is the line breaking tag in WML.
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML
1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<card id="card1" title="Line Break">
<p>
Before br<br/>After br
</p>
</card>
</wml>
Sujata Mishra 23
Font Size and Style
WML includes a number of tags that can be used to change the font
size and style of the text.
Some older WAP browsers do not support these tags or only support a
subset of these tags, even though these tags are defined by the WML
specification.
Unsupported WML tags will be ignored by WAP browsers but will not
cause any errors.
Bold: <b></b>
Underline: <u></u>
Italic: <i></i>
Big: <big></big>
Small: <small></small>
Emphasis: <em></em>
Strong: <strong></strong>Sujata Mishra 24
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD ML 1.3//EN"
"http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<card id="card1" title="Font Style">
<p>
<b>Bold</b><br/>
<i>Italic</i><br/>
<u>Underline</u><br/>
<small>Small</small><br/>
<big>Big</big><br/>
<em>Emphasis</em><br/>
<strong>Strong</strong>
</p>
</card>
</wml>
Sujata Mishra 25
WML : Tables
The <table> element may be used to display tabular data.
Attribute Description
align Determines how the table is aligned on the device.
•center
•left
•right
<wml>
<card id="page1" title="Table in WML">
<p>
<table columns="3" align="LCR">
<tr>
<td>Col 1</td> <td>Col 2</td> <td>Col 3</td>
</tr>
<tr>
<td>A</td> <td>B</td> <td>C</td>
</tr>
<tr>
<td>D</td> <td>E</td> <td>F</td>
</tr>
</table>
</p>
</card>
</wml>
Sujata Mishra 27
WML : Image
The <img> element is used to add an image to a WML card.
Sujata Mishra 28
Attribute Description
align Determines how the image is aligned with the text.
• top
• middle
• bottom
<wml>
<card id="card1" title="Image in WML">
<p>
<img src="smile.gif" alt="Smile" height="62" width="60" /><br/>
Welcome to our WML tutorial.
</p>
</card>
</wml>
Sujata Mishra 30
If the image file does not exist, the result will become:
Sujata Mishra 31
Linking Cards
A Element
The id attribute is used to identify the name of the card to
link to.
There are three ways of specifying a link to another card.
Absolute Link
– contains the full path to the page
– typically used to link to other WAP sites.
– example :
<a href="http://www.juicystudio.com/index.wml">
Visit Juicy Studio</a>
Sujata Mishra 32
Relative Link
– contains the name of the WML file, either in the
same directory, or with the relative path from the
current directory.
– example :
<a href="recent.wml">Recent Posts</a>
Relative Link to a particular card :
<a href="recent.wml#today">Recent Posts</a>
In-Document Link
– used for WML documents that contain more than
one card.
– uses the card id to locate the card.
– example :
<a href="#announce">Announcements</a>
Sujata Mishra 33
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="index" title="Index Page">
<p>
<a href="#first">First Link</a><br/>
<a href="#second">Second Link</a><br/>
<a href="#third">Third Link</a>
</p>
</card>
<card id="first" title="First Card">
<p>
This is the first card.<br/>
<a href="#index">Back to Index</a>
</p>
</card>
<card id="second" title="Second Card">
<p>
This is the second card.<br/>
<a href="#index">Back to Index</a>
</p>
</card>
<card id="third" title="Third Card">
<p>
This is the third card.<br/>
<a href="#index">Back to Index</a>
</p>
</card>
</wml> Sujata Mishra 34
Navigation
Anchor Element
The anchor element specifies the head of a link.
The tail of a link is specified as part of other elements.
e.g. a card name attribute.
Anchored links can not be nested.
The <anchor> element extends the <a> element to
perform a go, prev, or refresh task
go element- used to specify the URI.
prev element- used to return to the previous page.
refresh element- used to refresh the card's variables.
Sujata Mishra 35
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="index" title="Index Page">
<p>
<anchor>First Link<go href="#first"/></anchor><br/>
<anchor>Second Link<go href="#second"/></anchor><br/>
<anchor>Third Link<go href="#third"/></anchor>
</p>
</card>
<card id="first" title="First Card">
<p>
This is the first card.<br/>
<anchor>Back to Index<prev/></anchor>
</p>
</card>
<card id="second" title="Second Card">
<p>
This is the second card.<br/>
<anchor>Back to Index<prev/></anchor>
</p>
</card>
<card id="third" title="Third Card">
<p>
This is the third card.<br/>
<anchor>Back to Index<prev/></anchor> </p>
</card> Sujata Mishra 36
</wml>
WML Generic Metadata :<meta>
The meta element contains generic meta-information
relating to the WML deck.
Meta-information is specified with property names and
values.
Metadata is placed at the document head.
A WAP browser will ignore the metadata if it does not
understand the metadata's meaning.
metadata of any sort can be specified in a WML file
without affecting the cards' look.
Sujata Mishra 37
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD
WML 1.3//EN"
"http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<head>
<meta name="author" content="Andrew"/>
</head>
<card id="card1" title="WML Tutorial">
<p>Hello World</p>
</card>
</wml>
Sujata Mishra 38
Advantages of WML
WML is part of the WAP standard and its use is required.
WAP devices such as WAP phones will not accept large decks (1.4K
for some WAP phones).
Sujata Mishra 40
Conclusion
WML offers software developers an entirely new,
exciting platform on which to deploy their applications.
Sujata Mishra 41
References
www.seminartopics4u.org
http://en.wikipedia.org/wiki/Wireless_Markup_
Language
http://www.wapforum.org/
http://www.allnetdevices.com/faq
Sujata Mishra 42
Sujata Mishra 43
Sujata Mishra 44