1 Wireless Markup Language
2 Introduction Wireless Markup Language (WML), based on XML, is a markup language intended for devices that implement the Wireless Application Protocol (WAP) specification, such as mobile phones. It provides navigational support, data input, hyperlinks, text and image presentation, and forms, much like HTML (HyperText Markup Language). It preceded the use of other markup languages now used with WAP, such as HTML itselfA WML document is known as a “deck”. Data in the deck is structured into one or more “cards” (pages) – each of which represents a single interaction with the user.
3 Introduction WML decks are stored on an ordinary web server configured to serve the text/vnd.wap.wml MIME type in addition to plain HTML and variants. The WML cards when requested by a device are accessed by a bridge WAP gateway, which sits between mobile devices and the World Wide Web, passing pages from one to the other much like a proxy. The gateways send the WML pages on in a form suitable for mobile device reception (WAP Binary XML). This process is hidden from the phone, so it may access the page in the same way as a browser accesses HTML, using a URL. WML has a scaled down set of procedural elements which can be used by the author to control navigation to other cards.
4 WML WML Inherits From XMLWML Extends Interactivity to Cell Phones, Pagers, PDAs Display Varies Widely From Device to Device WML tags lack consistency across different manufacturers
5 WML Coding WML Based on a Deck of Cards -- the device only shows 1 card at a time Cards in a Deck can Interact with other Cards in Deck and Cards in External Decks
6 WML Coding All WML documents MUST have a specific headerThe Deck is delimited by the Hello World!
7 Entering Text Cards are delimited by the
8 WML Anchors (links) Similar to HTML links text Use # to reference a card (e.g. href = “#myCard”). Otherwise, will go to the first card in a deck
9 WML sample Site "http://www.wapforum.org/DTD/wml_1.1.xml">
10 WML sample site (cont.)
Find a Person
School Info
My CMU
11
First Name:
Last Name:
12 WML Sample Site (cont.)
13 WML Sample Site (cont.)
User ID:
Pass:
14 WML: Wireless Markup LanguageContent (XML) Tag-based browsing language: Screen management (text, images) Data input (text, selection lists, etc.) Hyperlinks & navigation support Takes into account limited display, navigation capabilities of devices XML-based language describes only intent of interaction in an abstract manner presentation depends upon device capabilities Cards and Decks document consists of many cards User interactions are split into cards Explicit navigation between cards cards are grouped to decks deck is similar to HTML page, unit of content transmission Events, variables and state mgmt XSL Processor WML Browsers WML Stylesheet HTTP Browser HTML StyleSheet
15 WML The basic unit is a card. Cards are grouped together into Decks Document ~ Deck (unit of transfer) All decks must contain Document prologue XML & document type declaration
16 WML Example Card Deck Navigation Variables Input Elements
17 A Deck of Cards Acme Inc. Directory _____________ Next Services
Directory
18 The DO Element Binds a task to a user actionAction type: ACCEPT, OPTIONS, HELP PREV, DELETE, RESET Label: Text string or image (optional) Task: GO PREV, REFRESH, NOOP Destination: URL Post data: if METHOD=POST
19 Bind a task to the ACCEPT action, when cursor points to a linkAnchored Links Bind a task to the ACCEPT action, when cursor points to a link TITLE= sets the label string (default = “Link”) Links are not allowed in select list options
20 The TEMPLATE Element Defines actions & events for all cards in a deck
21 Handling User Input Select lists Input fields KEY variablesChoose from a list of options Input fields Enter a string of text or numbers KEY variables Set by SELECT and INPUT elements How user input is passed to other cards and the application server
22 The SELECT Element Display a list of optionsEach option may set the KEY variable and/or bind a task to the ACCEPT key TITLE= dynamically sets the label string MULTIPLE=“TRUE”: Allows user to pick multiple items
23 The INPUT Element Prompts user to enter a string of text
24 WML Content Formats Common interchange formats, for interoperabilityBusiness cards: IMC vCard standard Calendar: IMC vCalendar standard Images: WBMP (Wireless BitMaP) Compiled WML, WMLScript Newly defined formats: WML text and tokenized format WMLScript text and bytecode format WBMP image format Binary format for size reduction Bytecodes/tokens for common values and operators Compressed headers Data compression (e.g. images) General-purpose transport compression can still be applied
25 Displaying Images Insert app images or local icons within display text1-bit BMP format Images are ignored by non-bitmapped devices Check HTTP_ACCEPT for “image/bmp” ALT="forward..."/>
ALT="Unwired Planet"/>
Welcome!
26 WML (other features) Setting card styles to create formsUsing variables to cache user data Using card intrinsic events to trigger transparent tasks Using timers Securing WML decks Bookmarking decks
27 WMLScript Complement to WML Provides general scripting capabilitiesDerived from JavaScript™ Provides general scripting capabilities Procedural logic, loops, conditionals, etc. Optimized for small-memory, small-cpu devices Features local user interaction, validity check of user input access to device facilities (phone call, address book etc.) extensions to the device software configure device, download new functionality after deployment Bytecode-based virtual machine Stack-oriented design, ROM-able Designed for simple, low-impact implementation WMLScript compiler resides in the network
28 WMLScript Libraries Lang - VM constants, general-purpose math functionality, etc. String - string processing functions URL - URL processing Browser - WML browser interface Dialog - simple user interface Float - floating point functions
29 WML Script Example Functions Variables Programming Constructsfunction currencyConvertor(currency, exchRate) { return currency*exchangeRate; } function myDay(sunShines) { var myDay; if (sunShines) { myDay = “Good”; } else { myDay = “Not so good”; }; return myDay; Variables Programming Constructs