understand wml chao-hsien chu, ph.d. school of information sciences and technology the pennsylvania...

28
Understand WML Understand WML Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University

Upload: allan-joseph

Post on 25-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Understand WMLUnderstand WML

Chao-Hsien Chu, Ph.D.School of Information Sciences and Technology

The Pennsylvania State University

Possible Service Types by WAPPossible Service Types by WAP

WAP

CallHandling

Messaging

InformationServices

ElectronicCommerce Database

AccessTransport

Gamming

LocalDevelopment

Services

Limitations of WirelessLimitations of Wireless

Physical Devices: Size / Display Memory / Cache Size Battery Data Entry Methods

Contents: Different Standards Micro browser Scarcity of contents Block internet surfing. Character-based Info.

Networks: Bandwidth limitations. Incomplete service coverage. Lack of an installed user base. High customer cost. Changing communications

standards. Latency Connection reliability

Security.

Infoservices

Telecomservices

E-mail

WWWMessageServices

InfoSecurityCallcontrol

Unifiedmailbox

ITTP

SIM toolkitTTML

HDML

Other

WAP

Why New StandardWhy New Standard

WAP ArchitectureWAP Architecture

WSP/WTP HTTP

WebServer

WAPGateway

WAPClient

WMLWMLScript

WTAI

WML InterpreterWML EncoderWML Script

CompilerProtocol Bearers

CGI Scripts(PERL, ASP,

Java)WML and

WMLScriptContents

Internet

Internet

Sketch of WAP Network ArchitectureSketch of WAP Network Architecture

WirelessNetwork

WTAserver

WAPgateway

Filter

Webserver

Webserver

WAPgateway

Firewall

WMLHTML

Corporate

Internet Protocol vs. WAPInternet Protocol vs. WAP

Other Services

and Applications

IS-136 CDMASMS CDPDUSSD CSD PDC Etc.

Bearers

Transport Layer (WPD)

Security Layer (WTLS)

Transaction Layer (WTP)

Session Layer (WSP)

Application Layer (WAE)

HTTP

TCP/IPUDP/IP

TLS-SSL

HTMLJavaScript

Wireless Application ProtocolWireless Application Protocol

Other Services

And Applications

IS-136 CDMASMS CDPDUSSD CSD PDC Etc.

Bearers

Transport Layer (WPD)

Security Layer

Transaction Layer

Session Layer

Application Layer

WAP Protocol StackWAP Protocol Stack

OSI Layer WAP Protocol

Application LayerWAE

Wireless Application Environment

Session LayerWSP

Wireless Session Protocol

Transaction LayerWTP

Wireless Transaction Protocol

Security LayerWTLS

Wireless Transport Layer Security

Transport LayerWDP

Wireless Datagram Protocol

Server ConfigurationServer Configuration

File Type Extension MIME Type

HDML .hdml text/x-hdml

WML .wml text/vnd.wap.wml

WMLScript .wmls text/vnd.wap.wmlscript

Compiled WML .wmlc application/vnd.wap.wmlc

Compiled WMLScript .wmlsc application/vnd.wap.wmlscriptc

WBMP .wbmp image/vnd.wap.wbmp

WML StructureWML Structure

• Deck - File

• Card – Screen

• Head: XML, DTD Declarations

• Template: <template>, </template>

• Root Element: <wml>, </wml>

• Card: <card>, </card>

WML StructureWML Structure

<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">

<wml> <template>

… </template> <card> <p>

… </p> </card></wml>

Document TypeDeclaration

Process Instruction

Root Element

Template

Cards

WML’s FunctionalityWML’s Functionality• Text Presentation and Layout: text formatting,

line breaks, and alignment.• Images – Wireless Bitmap (WBMP) and image

alignment.• User Inputs – Choice lists, multilevel choices,

text entry, and task controls.• Cards and Deck Organization.• Navigation – URL Naming and anchored links,

between cards in a deck, between decks.• State and Context Management – Variable

passing between decks, Cache both variables and decks.

Text PresentationsText Presentations

There is no support for font

Paragraph <p> </p>

Line break <br/>

Big style <big> </big>

Bold face <b> </b>

Emphasis <em> </em>

Italic <i> </i>

Small <small> </small>

Strong <strong> </strong>

Underline <u> </u>

ParagraphParagraph

• <p> </p>• Two attributes:• align = “left”, “center” or “right”• mode = ‘wrap” or “nowrap”

Attribute Effect

<p align=“left”> </p> Left alignment of paragraph

<p align=“center”> </p> Centered alignment of paragraph

<p align=“right”> </p> Right alignment of paragraph

Special CharactersSpecial Characters

Name Char ASCII Escape Sequence

Ampersand & &#38; &amp;

Apostrophe ‘ &#39; &apos;

Dollar Sign $ &#24; $dol; or $$

Greater Than > &#62; &gt;

Less Than < &#60; &lt;

Spaces &#160; &nbsp;

Quote “ &#34; &quot;

Soft Hyphen - &#173; &shy;

ASCII Characters &#nn;

TableTable

• <table </table>

• Attributes:

align Alignment - left, center, right

title Name a table

columns Number of columns

<tr> </tr> Define row

<td> </td> Define column

Image - <img>Image - <img>

src URL of the image to display

localsrc Local known icon

align Top, middle,bottom

width Width - Number of pixels or %

height Height - Number of pixels or %

hspace Horizontal space -Number of pixels

vspace Vertical space - Number of pixels

alt Alternative text to display

Navigation between Cards and DecksNavigation between Cards and Decks

Type of Links Syntax

Link to another card in the same deck

<a href=“#card2” title=“Card 2”>Second Card </a>

Link to another card in different deck on same server

<a href=“xxx.wml#card2” title=“Other Deck”>Another Deck</a>

Link to another deck on a different server

<a href=“http://www.xxx.com/xxx.wml”> Different Server </a>

• <a> … </a>• <anchor> … </anchor>

Events and TasksEvents and Tasks

Actions Meaning Example

accept Cause task to occur same as OK

<do type=“accept”>

<go href=“#card2”/> </do>

prev Return to previous <do type=“prev”> <prev /> </do>

help Request help <do type=“help”>

<go href=“#help”> </do>

reset Reset the devices <do type=“reset”> </do>

options Ask for more operations

delete Remove an item

unknown Map a task to any key

EventsEvents

• <onenterforward>: Invoke a card via a GO statement.

• <onenterbackward>: Navigate to a card via the <prev> statement.

• <onpick>: Select an option.• <ontimer>: Delay time for action.• These events are invoked via an <onevent>

element, an <option> element, or as part of a <template> or <card> element.

Input AttributesInput Attributes

Attribute Description

name Name of the variable to receive a value

value Default value for the variable

maxlength Max. # of characters to accept use input

size Number of characters for browser to display

type Text or password

format Format of input data (controlled by input mask)

emptyok Boolean (returns a value of either true or false)

Input MaskInput Mask

Specifier Format Control

A Uppercase, nonnumeric characters

a Lowercase, nonnumeric characters

N Numerical characters, including (+) and (-)

X Uppercase, alphabetic, numeric, punctuation

x Lowercase, alphabetic, numeric, punctuation

M Any character, browser assumes uppercase

m Any character, browser assumes lowercase

*f Any number of characters followed by format

Nf Limited to “n” number of characters

\v Literal character is output, input prohibited.

Attributes of Do ElementAttributes of Do Element

Attribute Description

type Provide a hint to the browser about how it should be displayed

label Specify the string used for the label.

name Specify a programmatic name for the do element binding, especially when multiple do elements are bound to the same card

optional Determine whether the do element may be ignored

Hardware Key TypesHardware Key Types

Key Type Description

accept Acknowledgement or acceptance

prev Backward navigation

help Request for help

reset Clears or resets the state

options Request for options or additional operations

delete Delete an item or choice

unknown Is equivalent to an empty string

Action TypesAction Types

Action Type Description

go Goes forward

prev Go backward using the history stack

refreshRefresh the screen after updating variable values

noop Indicate no action should be taken

Example of Do ElementExample of Do Element

<do type=“options” label=“titles” name=“titles”>

<go href=“#titles”/>

</do>

<do type=“options” label=“Authors” name=“authors”>

<go href=“#authors”/>

</do>

<do type=“options” label=“Books” name=“books”>

<go href=“#booklist”/>

</do>

Thank You?

Any Question?