XML

Document Sample
XML Powered By Docstoc
					          WML
Wireless Markup Language




                           1
                 WML

There is a lot to take in account when
designing internet applications to be
accessed on a wireless device. For
example:




                                         2
                  WML

1) With small displays it is impossible to
output large amounts of text
2) Typically only four lines of text are
available, with 15-18 characters each
3) Graphics capabilities are minimal



                                             3
                 WML

4) Text entry is difficult. Phone
keypads, as an example, are not user
friendly
5) Limited bandwidth makes for slow
access
6) Batteries limit the power of electronic
circuits, resulting in low processing
power
                                             4
                WAP

The Wireless Application Protocol
(WAP) is currently the primary way of
accessing the internet via a cellular
phone. The WAP forum (wap.org) has
defined specifications that include
complementary application, session,
transaction, security, and transport
protocol layers.
                                        5
                WML

In the same time period, the Wireless
Markup Language (WML) was
developed by the W3C, as a subset of
XML.




                                        6
                 WAP

The intention of WAP is to utilize the
underlying web structure to render
communication between content
providers and cellular phones more
efficient than if the current web
protocols were used.


                                         7
          WAP Gateway

The significant difference between
WAP and the existing web is the WAP
gateway for translating between HTTP
and WAP.




                                       8
            WAP Device

The WAP device is the physical device
you use to access WAP applications,
mobile phones, PDAs, or handheld
computers, as an example.




                                        9
            WAP Device

Software running on the WAP device
that interprets content coming from the
internet and determines how to display
that content on the WAP device, is the
WAP browser.



                                          10
          WAP Browsers

WAP browsers are available for all
WAP devices and can be referred to as
microbrowsers.




                                        11
             WAP Device

The requirement for a WAP device to
be WAP compliant, is that it must
implement a Wireless Application
Environment User Agent (WAE User
Agent) in order to render the content for
display.


                                            12
           WAP Device

WAP compliance also requires a
Wireless Telephony Applications User
Agent (WTA User Agent) to receive
compiled WTA files from a WAP server
and execute them.



                                       13
          WTA User Agent

The WTA User Agent includes access
to the interface to the phone and
functionality such as number dialing,
call answering, phone book
organization, message management,
and location indication services.


                                        14
            WAP Stack

The WAP Stack implementation allows
the phone to connect to the WAP
gateway, using the WAP protocols.




                                      15
           WAP Servers

WAP servers function in much the
same way as a web server and can
coexist on the same WAP device. The
difference between WAP and web
servers is in they content they store
and send to the client. Web servers
support files such as HTML,
JavaScript, XHTML, XML, and images.
                                        16
            WAP Servers

WAP servers support files such as
WML, WMLScript, WBMP (Wireless
Bitmap Image files). WAP servers are
typically WAP application servers with
gateway functionality, providing
services web origin servers provide and
acting as a WAP gateway.

                                          17
                WML

WML displays, for the most part, text-
based pages. WML shares elements of
HTML 4 and HDML 2 (Handheld
Device Markup Language), and is
defined as an XML document type.



                                         18
             WML Deck

Every WML document is called a single
deck, made up of one or more than one
card. As users access a WAP enabled
site, the deck is sent to the WAP device
of which the user sees the first card,
reads the content, and may enter
information or proceed to a second
card.
                                           19
             WML Deck

The way the cards are displayed is
dependent on the browser, through
such interfaces as user prompts.




                                     20
           WML Deck

Every WML deck begins the XML
header:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-
//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wm
l_1.1.xml">
                                  21
              WML Deck

The first line is your usual XML prolog.
The second line selects the Document
Type Definition and gives its URL.
Many WML toolkits automatically
generate the WML header.



                                           22
             WML Deck

The main WML code of a deck is
enclosed in the element pair:
<wml>...</wml>
which act as the body of the document.
Cards are defined within the deck
within the element pair:
<card>...</card>
                                         23
             WML Deck

<card> may have different attributes,
you will work with attributes id and
title. The id attributes gives the card
an identifier to be used as reference by
other parts of the WML.



                                           24
             WML Deck

The title attribute gives the name of
the card to be presented by the user.
Not all WML browsers support title,
card design shouldn’t rely on title
unless tested.



                                        25
             WML Deck

<wml><card id="MainCard"
title="This is a first card">
<p align="center">
Welcome to WML
</p>
</card></wml>

                                26
            Elements

In this example, <p> has the same
meaning as in HTML, but must be
closed, as in XHTML and XML. Space
limits the numbers of <p> used.




                                     27
              Deck Example

<?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="MainCard" title="This is a first
card"><p align="center">
  Welcome to WML        </p>
<p>This is first wml example</p> </card>

                                                   28
               Elements

Although the number of supported
elements is smaller than the full
specification of HTML or XHTML,
several options are available. The WAP
browser may present text in bold,
underlined, italics, with line breaks and
tables, checkboxes, radio buttons,
depending on the capabilities of the
WAP device.                                 29
              Elements

Black and white images, compliant with
WBMP standards, are supported on
some WAP browsers.




                                         30
                  Style

WML supports the following text style
tags:
<b>..</b> bold, text will display as
bold
<i<>..</i> italic, text will display in
italic
<u>..</u> underlined, text will display
underlined                                31
                 Style

<e>..</e> emphasis, text will display
emphasized
<strong>..</strong> strong, text will
display stronger
<big>..</big> big, text will display
larger
<small>..</small> small, text will
display smaller                         32
        Escape Characters

>    &gt;
<    &lt;
"   &quot;
As an example, the expression 10>20
="false"
is written as:
10 &gt; 20 =&qout;false&quot;
                                      33
              Graphics

WML supports graphics, although
minimally because of screen size.
Images have the extension .wbmp.
Some companies, offer tools to
transform images from jpeg or gif to the
.WBMP format. There are also tools
which can be used to create drawings.

                                           34
             Navigation

The WAP device loads the deck of
cards, and displays cards one at a
time. Each card contains both content
and navigational control, since a WAP
device has the capability to hold many
different cards.


                                         35
             Navigation

Navigation is important because by
accessing or returning several cards at
once, trips to the WAP browser are
reduced, allowing additional content to
be stored locally.



                                          36
                Links

Linking from one resource to another is
accomplished with an anchor link, the
WML form of which is:
<a>go href="location"</a>




                                          37
               Links

It is possible to substitute
<anchor></anchor> for <a></a>.
location can be a URL such as:
href="http://www.learningcentre.org/i
ndex.wml



                                    38
                  Links

or a file, in the same directory, such as:
href="style.wml"




                                             39
                 Links

or a new card, selected with:
href="#nextCard"
specified with the symbol # before the
card ID




                                         40
            Optimization

WML is designed to adapt to the high-
latency and narrow-band
characteristics of wireless networks.
According to the WAP specifications,
connections with the origin server
should be avoided unless absolutely
necessary.

                                        41
             Optimization

This can be accomplished by
introducing variables that last longer
than a single deck and by grouping
cards in decks, along with client-side
user input validation with WMLScript.



                                         42
             Optimization

In the wireless networks where WAP is
implemented, a WAP gateway is
installed and connected to the wireless
network Local Area Network (LAN). A
new phone number is defined and
assigned to an access server. When a
browsing session is initiated, a call is
placed to that number.
                                           43
            Optimization

The access server only authenticates
the subscriber attempting to contact the
gateway. Authentication takes place via
a database storing valid subscribers
and their number. Once validation is
complete, the call is connected to the
internal LAN and is allowed to
communicate directly with the WAP
gateway.                                   44
            Optimization

Once the gateway connection is
established, the browser in the phone
automatically sends subscriber details
to the gateway along with a user name
and password. The gateway checks
against a database, much like a dialup
connection to the internet is checked
and validated with a PC.
                                         45
             Optimization

The WAP browser has an associated
homepage deck, set up by the service
provider, which loads into the
microbrowser after the user has been
authenticated. The deck is a WAP
portal, allowing links and services from
that gateway.

                                           46
            Optimization

The challenge for the developer is to
create cards where the user can, with
the limitations of a phone keypad,
accomplish their goals and tasks.




                                        47
             do elements

The do elements in WML documents
define an event to be triggered. As in:
<do type "typelist"
actionlist
</do>


                                          48
              Attributes

The possible values of the type
attributes are:
accept -acceptance on mobile phone it
is usually the left softkey
prev -previous is the back bottom
usually the right softkey
help -button pressed to request help
                                        49
              Attributes

reset -the reset button for the device
options -the button request asking for
more operations
delete -the button pressed to remove
an item
unknown -can be mapped to any key
on the device
                                         50
           Input Elements

The browser decodes input tags then
determines the best way to prompt the
user for the input requested. WML
specifies tags for allowing users to
submit text entries, choose among a list
of options, or begin a navigation or
history management task such as
going to the previous card or jumping to
a specified link.                        51
 Navigation and History Tracking

WML includes common navigation and
history functionalities. User input
determines how previous and next
cards will be accessed.




                                      52
               Variables

Variables in WML are simple and are
used to store data to be used in
different cards. Variables can be
specified with the setvar (set variable)
command or an input element. Both
are case sensitive and must be
referenced with the sign $ in front of
name as in, $(name)
                                           53
           Additional Input

When users interact with links, the
option list and select list give limited
possibilities because users can only
make choices determined in the
application. In many application there is
a need for a more active user role,
such as keyin in numbers (credit card)
or strings (name, password).
                                            54
           Additional Input

In WAP for this kind of activity you can
use <input>. The data keyed in the
input field are captured and assigned to
a variable. The name attribute of
<input> is used to specify the name of
variable, as in:
<input name="movieName" />

                                           55
                Timers

In WAP applications you can used
timers to open an application for a
defined period of time. This feature can
be used for displaying logos,
advertising, or for updating information
at regular intervals.


                                           56
        Hybrid Technologies

You can use XSLT to transform XML
documents to WML documents. This
technique is especially useful on the
server side when you want to create
documents for different output devices.



                                          57
        Hybrid Technologies

One document will be opened by the
standard browser (IE5, Netscape,
Opera) and the other with
microbrowser. Because the devices on
which the documents will be displayed
have different features, you will need to
develop different layouts, taking into
account all limitations of the devices.
                                            58
             Server Side

Because processing power of WAP
devices is limited (the short battery
lifetime is the main cause) the main
processing needs to be done on the
server side. As such, it is important to
use server side technologies such as
ASP or JSP for processing documents.

                                           59
          WML
Wireless Markup Language
        Last Slide




                           60

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:10/4/2011
language:English
pages:60