Images

WAP / WML - PART I


WAP/WML
WML (Wireless Markup Language) is the new web language for making sites on mobile phones.
Over the past few months new WAP (Wireless Applications Protocol) phones have become extremely popular and many large websites have created special 'mobile' versions of their site.
Many people predict that, over the next few years, WAP sites will become even morepopular and e-commerce over mobile phones will be widely available.
Wireless Markup Language(WML) based on XML, is a content format for devices that implement the Wireless Application Protocol (WAP) specification, such as mobile phones, and preceded the use of other markup languages now used with WAP, such asXHTML and even standard HTML (which are gaining in popularity as processing power in mobile devices increases).


Introduction to WAP/WML
Evolution of XML
The eXtensible Markup Language (XML) is a general-purpose markup language. Its primary purpose is to facilitate the sharing of data across different information systems, particularly via the Internet.
It is a simplified subset of the Standard Generalized Markup Language (SGML), and is designed to be relatively human-legible. By adding semantic constraints, application languages can be implemented in XML. These include XHTML, RSS, MathML, GraphML, Scalable Vector Graphics(SVG), MusicXML, and thousands of others. Moreover, XML is sometimes used as the specification language for such application languages.
XML is nothing by itself. XML is more of a "common ground" standard. The main benefit of XML is that you can take data from a program like MSSQL(Microsoft SQL), convert it into XML, then share that XML with a slough of other programs, platforms, etc. Each of these receiving platforms can then convert the XML into a structure the platform uses normally and presto! you have just communicated between two potentially very different platforms!
What makes XML truly powerful is the acceptance and hard work done by all those who work with databases, programming, office application, etc. It is because of this hard work that the tools exist to do these conversion from whatever platform into standardized XML data or convert XML into a format used by that platform.
In the past, attempts at creating a standardized format for data that could be interpreted by many different platforms (i.e. different applications) failed miserably where XML has largely succeeded.
What is XML?
• XML stands for EXtensible Markup Language

• XML is a markup language much like HTML.

• XML was designed to describe data.

• XML tags are not predefined in XML. You must define your own tags.

• XML is self describing.

• XML uses a DTD (Document Type Definition) to formally describe the data.
XML is extensible
The tags used to markup HTML documents and the structure of HTML documents are predefined. The author of HTML documents can only use tags that are defined in the HTML standard. XML allows the author to define his own tags and his own document structure. It is important to understand that XML is not a replacement for HTML. In the future development of the Web it is most likely that XML will be used to structure and describe the Web data, while HTML will be used to format and display the same data.
XML usage
Although there are countless of applications that use XML, here are a few examples of the current platforms and applications that are making use of this technology.
Cell Phones - XML data is sent to some cell phones, which is then formatted by the specification of the cell phone software designer to display text, images and even play sounds!
File Converters - Many applications have been written to convert existing documents into the XML standard. An example is a PDF to XML converter.
VoiceXML - Converts XML documents into an audio format so that you can listen to an XML document.

Introduction to WAP/WML
Introduction
WML is a markup language that is based on XML (eXtensible Markup Language). The official WML specification is developed and maintained by the WAP Forum, an industry-wide consortium founded by Nokia, Phone.com, Motorola, and Ericsson. This specification defines the syntax, variables, and elements used in a valid WML file.
WML is based on XML, a markup language that has garnered enormous support due its ability to describe data (HTML, meanwhile, is used to describe the display of data...a big difference).
While HTML predefines a "canned" set of tags guaranteed to be understood and displayed in a uniform fashion by a Web browser, XML allows the document creator to define any set of tags he or she wishes to. This set of tags is then grouped into a set of grammar "rules" known as the Document Type Definition, or DTD.
WML (Wireless Markup Language) is the new web language for making sites on mobile phones. Over the past few months new WAP (Wireless Applications Protocol) phones have become extremely popular and many large websites have created special 'mobile' versions of their site. Many people predict that, over the next few years, WAP sites will become even morepopular and e-commerce over mobile phones will be widely available.
Why Use WML?
Although you might not have any plans immediately for creating a WAP version of your site, it is always a good idea to get involved in new technology. All you need to do is make a small site (even one page) which tells people a bit about your website. In the future you can develop the site further with things like e-mail and information for people to get directly off their phones.
The main sites which will benefit from WAP are ones providing a service like e-mail, live sports scores or a calendar service etc. but there are many other uses. For example, a site giving music reviews could put their reviews on a WAP site. People could then read the reviews on their mobile phone while browsing through the CDs in a shop.

Introduction to WAP/WML
Benefits of WAP
Operators
For wireless network operators, WAP promises to decrease churn, cut costs, and increase the subscriber base both by improving existing services, such as interfaces to voice-mail and prepaid systems, and facilitating an unlimited range of new value-added services and applications, such as account management and billing inquiries.
New applications can be introduced quickly and easily without the need for additional infrastructure or modifications to the phone. This will allow operators to differentiate themselves from their competitors with new, customized information services.
WAP is an interoperable framework, enabling the provision of end-to-end turnkey solutions that will create a lasting competitive advantage, build consumer loyalty, and increase revenues.
Content Providers
Applications will be written in wireless markup language (WML), which is a subset of extensible markup language (XML). Using the same model as the Internet, WAP will enable content and application developers to grasp the tag-based WML that will pave the way for services to be written and deployed within an operator's network quickly and easily.
As WAP is a global and interoperable open standard, content providers have immediate access to a wealth of potential customers who will seek such applications to enhance the service offerings given to their own existing and potential subscriber base.
Mobile consumers are becoming more hungry to receive increased functionality and value-add from their mobile devices, and WAP opens the door to this untapped market that is expected to reach 100 million WAP–enabled devices by the end of the year 2000. This presents developers with significant revenue opportunities.
End Users
End users of WAP will benefit from easy, secure access to relevant Internet information and services such as unified messaging, banking, and entertainment through their mobile devices. Intranet information such as corporate databases can also be accessed via WAP technology.
Because a wide range of handset manufacturers already supports the WAP initiative, users will have significant freedom of choice when selecting mobile terminals and the applications they support.
Users will be able to receive and request information in a controlled, fast, and low-cost environment, a fact that renders WAP services more attractive to consumers who demand more value and functionality from their mobile terminals.
As the initial focus of WAP, the Internet will set many of the trends in advance of WAP implementation. It is expected that the Internet service providers (ISPs) will exploit the true potential of WAP. Web content developers will have great knowledge and direct access to the people they attempt to reach.
In addition, these developers will likely acknowledge the huge potential of the operators' customer bases; thus, they will be willing and able to offer competitive prices for their content. WAP's push capability will enable weather and travel information providers to use WAP.
This push mechanism affords a distinct advantage over the WWW and represents tremendous potential for both information providers and mobile operators.

Basics of WML
Structure of WML document
Declaring A WML Document
when you are creating a WML document all you need is notepad or another text editor, just like for HTML. The first thing you should enter is:
<xml version='1.0'>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
this tells the phone that it is interpreting a WML document and which WML standards it is using.
Cards
Instead of having pages, WAP sites have cards. These are what is displayed on the screen at one time, just like a page. More than one card can be inserted in each WML document.
To declare a card, insert the following:
<card title="My First WAP Page" id="index" newContest="true">
If a phone or other communications device is said to be WAP-capable, this means that it has a piece of software loaded onto it (known as a microbrowser) that fully understands how to handle all entities in the WML 1.1 DTD.
The first statement within an XML document is known as a prolog. While the prolog is optional, it consists of two lines of code: the XML declaration (used to define the XML version) and the document type declaration (a pointer to a file that contains this document’s DTD). A sample prolog is as follows:
<xml version='1.0'> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
Following the prolog, every XML document contains a single element that contains all other subelements and entities. Like HTML all elements are bracketed by the
<> and </>
characters. As an example: <code><element>datadatadata</element></code>. There can only be one document element per document. With WML, the document element is <code><wml></code>; all other elements are contained within it.
The two most common ways to store data within an XML document are elements and attributes. Elements are structured items within the document that are denoted by opening and closing element tags. Elements can also contain sub-elements as well. Attributes, meanwhile, are generally used to describe an element. As an example, consider the following code snippet:
<!-- This is the Index Card -->
<card id="index" title="My First WAP Page "" newContest="true">
        <p>Welcome to <b>eBIZ.com</b>.<br /><b>Vision to Reality</b><br />
            <img src="http://ebizel.com/img/logo.gif" alt="eBIZ Logo"  id="logo"/>
        </p>	
</card>
<!—End of the Index Card-->
In the code above, the card element contains the id and title attributes. (On a side note, a comment in WML must appear between the tags.) We will make use of the WML-defined elements and their attributes later as we build our examples.
Sample WML Page:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
 "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
    <card title="My First WAP Page" id="index" newContest="true">
        <p>Welcome to <b>eBIZ.com</b>.<br/><b>Vision to Reality</b><br/>
            <img src="http://ebizel.com/img/logo_in.gif" alt="eBIZ Logo" id="logo"/>
        </p>
        
    </card>
    <card title="My 2nd WAP Page" id="pg2">

        <p>Welcome to <b>eBIZ.com</b>.<br/><b>Vision to Reality</b><br/>
            <img src="http://ebizel.com/img/logo_in.gif" alt="eBIZ Logo" id="logo"/>
        </p>
        
    </card>
    
    
</wml>
Output of the Sample WAP page:
img01

Basics of WML
The <wml> Tag
<wml> is the root element of WML documents, like <html> for HTML documents. A major difference between HTML and WML is that the basic unit of navigation in HTML is a page, while that in WML is a card.
A WML file can contain multiple cards and they form a deck. When a user goes to a WAP site, the mobile browser loads a WML file that contains a deck of cards from the server. Only one card will be shown on the screen of the wireless device each time.
If the user goes to another card of the same deck, the mobile browser does not have to send any requests to the server since the file that contains the deck is already stored in the wireless device.
WML is designed in this way because wireless devices have a high latency for connecting to the server. Downloading a deck of cards at a time can lower the number of round trips to the server. You can put links, text, images, input fields, option boxes and many other elements in a card.
Sample WML Document:
<?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="card1" title="Sample WML">
        <p><strong>Hello WAP World!!</strong></p>
    </card>
</wml>
Output of the sample WAP document on different WAP browsers:
img02
Nokia 6600
img03
Sony Ericsson W610i

Basics of WML
Basic WML Tags
WML predefines a set of elements that can be combined together to create a WML document. These elements include can be broken down into two groups: the Deck/Card elements and the Event elements.
1) Deck/Card Elements
i)	wml
ii)	card	
iii)	template	
iv)	head	
v)	access	
vi)	meta
2) Event Elements
i)	do	
ii)	ontimer	
iii)	onenterforward	
iv)	onenterbackward	
v)	onpick	
vi)	onevent	
vii)	postfield
3) Tasks
i)	go	
ii)	prev	
iii)	refresh	
iv)	noop
4) Variables
i) setvar
5) User input
(1)	input	
(2)	select	
(3)	option	
(4)	optgroup	
(5)	fieldset
6) Anchors, Images, and Timers
a)	a	
b)	anchor	
c)	img	
d)	timer
7) Text Formatting
i)	br	
ii)	p
iii)	small
iv)	strong
v)	b

Basics of WML
WML Comments
Comments are placed inside <!-- --> in WML. This is the same as HTML. For example, the following lines are comments. WAP browsers ignore all comments.
<!-- This is a comment in WML -->
<!-- This is a multi-line comment -->

WML Formatting Tags
The <p> Tag
The <p> element defines a paragraph of text. Besides text, things such as anchor links and images can be included in the <p> element. WAP browsers always render a paragraph on a new line.
The <p> element supports two attributes: align and mode. The align attribute is used to change the horizontal alignment of a paragraph. The values left, center and right are supported.
This tag can be used to set the alignment and line wrapping values for a paragraph which is accomplished using the align and mode attributes.
If you do not set the text alignment, the default is for the text and images to resume at the left margin of the display.
In general, most browsers automatically line wrap texts that are too long to display in one line and you may find that you cannot turn this line wrapping off. (Line wrapping is used to prevent a long text from disappearing from view by running out of the right margin of the display.) Technically, the default for line wrapping is that the current paragraph element inherits the value of the line wrap mode attribute from the previous paragraph element in the current card. However, if there is no previous paragraph, the current p element inherits the line wrap mode value of the card.
Nested Tags: a anchor b big br do em fieldset i input img select small strong table u
Attributes
align
The optional align attribute is used to align the starting text or image in the paragraph element at the left or right margin, or in the center.
class
The optional class core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e., Stocks and stocks are not the same).
id
The optional id core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
mode
The optional mode attribute is used to declare whether there is line wrapping or no line wrapping. Correspondingly, there are only two permitted values, wrap and nowrap. This attribute may not be recognized by some browsers. The default is to line wrap.
Example:
Source code of para.wml
<?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="card8" title="WML <p> Tag">
        <p>
            This example will demonstrate you
 how "p" or "paragraph" tag works in WML.<br />
         </p><br />
        <p id="para1" align="right"> Sample Paragraph
 with Right Alignment.</p><br />
        <p id="para2" mode="nowrap"> Sample Paragraph 
with Default Alignment & nowrap mode.</p><br />
        <p id="para3" align="center"> Sample Paragraph 
with center Alignment.</p><br />
    </card>
</wml>
Output:
img06

WML Formatting Tags
The <b> Tag
The b tag renders the specified text in a bold font format. The exact text appearance may be browser dependent.
Although WML is a small language, there are seven tags that can affect the appearance of a character or text of which four, b, em, i, and strong, add some sort of emphasis. (The other three are big, small, and u.) There may be no difference in the display appearance between the b or the em tags.
Nested Tags: a anchor b big br em i img small strong table u
Attributes:
class The optional class core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e., Stocks and stocks are not the same).
id
The optional id core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
xml:lang
The optional xml:lang attribute sets the language used in the element, such as English or Greek. For example, in the U.S. the default value is en-US.
<b> Tag Example: source code bold.wml
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" 
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
    <card title="<b> Tag: WAP Tutorial" id="page6" >
        <p>
            <b>This is Bold WAP Text</b>
        </p>
        
    </card>
    
    
    
</wml>
This is how, above page will look in WAP browser:
bold.wml in Nokia 6600
img04
In Nokia 6670
img

WML Formatting Tags
The <em> and <i> Tag
<em> Tag
The em tag renders the specified text in an emphasized font format. The exact text appearance may prove to be browser dependent.
Although WML is a small language, there are seven tags that can affect the appearance of a character or text. Four tags, b, em, i, and strong, add some sort of emphasis. (The other three are big, small, and u.) There may be no difference in the display appearance between the b or the em tags.
Nested Tags: a anchor b big br em i img small strong table u
Attributes
class
The optional class core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e., Stocks and stocks are not the same).
id
The optional id core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
<i> Tag
The i tag renders the specified text in an italic font format. The exact text appearance may prove to be browser dependent. Although WML is a small language, there are seven tags that can affect the appearance of a character or text. Four tags, b, em, i, and strong, add some sort of emphasis. (The other three are big, small, and u.) There may be no difference in the display appearance between the i or the strong tags.
Nested Tags: a anchor b big br em i img small strong table u
Attributes
class
The optional class core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e., Stocks and stocks are not the same).
id
The optional id core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
Example:
Source code for em.wml:
<?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="card7" title="WAP <em>& <i> Tags">
        <p>
            Wap Tutorial:<br /><br /><br /></p>
        <p>
            This example will demonstrate you how "i" 
and "em" tags works in WML.<br />
            <br />
        </p>
        <p>
            <em>Simple <em> Text.</em><br /><br />
            <i>Simple <i> Text.</i><br />
        </p>
    </card>
</wml>
Output of em.wml:
img05

WML Formatting Tags
The <strong> Tag
The strong tag renders the specified text in some sort of strongly emphasized font format. The exact text appearance may prove to be browser dependent.
Although WML is a small language, there are seven tags that can affect the appearance of a character or text. Four tags, b, em, i, and strong, add some sort of emphasis. (The other three are big, small, and u.) There may be no difference in the display appearance between the i or the strong tags.
Nested Tags: a anchor b big br em i img small strong table u
Attributes
class
The optional class core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive (i.e., Stocks and stocks are not the same).
id
The optional id core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
Example:
Source code of strong.wml
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
 "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
    <card title="WAP Tutorial:<small> Tag" id="page9">
        <p>
            <strong>
                STRONG WAP Text.
                </strong>
                <br />
            & this is normal WAP Text.
        </p>
    </card>
</wml>
Output:
img07

WML Formatting Tags
<u> Tag
The u tag cause the specified text to be underlined.
Although WML is a small language, there are seven tags that can affect the appearance of a character or text (b, big, em, i, small, strong, and u).
Nested Tags: a anchor b big br em i img small strong table u
Attributes
class
The optional class core attribute is used to assign one or more classes to the element. Multiple classes are separated by white space. The class name is case sensitive.
id
The optional id core attribute is used to assign a unique name to a tag. The name must be unique to the entire deck and not just unique to a card. The first character of the name can be a letter or the underscore. The remaining characters can be any combination of letters, numbers, or underscores.
Example:
Source code of u.wml
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
 "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
    <card title="WAP Tutorial:<u> Tag" id="page9">
        <p>
            The <u>  tag cause the specified text to be <u>underlined</u>. 
            <br />
        </p>
        <p>Although <u>WML</u> is a small language, 
there are seven tags that can affect the appearance of a character or text
            <br /> <b>and these are:</b><br />
            
        </p>
        <p align="center">
            <u>b</u>, 
<br />
 <u>big</u>, 
 <br />
<u>em</u>,  
<br /> 
<u>i</u>,  <br />
<u>small</u>, <br /> 
<u>strong</u>,  <br />
and  <br />
<u>u</u>. 
        </p>
    </card>
    
    
</wml>
Output of above code on a typical wap enable browser.
img000

0 comments: