Lectured By: Vivek Dimri Assistant Professor, CSE Dept. SET, Sharda University, Gr. Noida
Introduction WML stands for Wireless Markup Language WML is an application of XML, which is defined in a document-type definition. WML is based on HDML (Handheld Device Markup Language) and is modified so that it can be compared with HTML. WML takes care of the small screen and the low bandwidth of transmission. WML is the markup language defined in the WAP specification.
Introduction WML files have the extension ".wml". WML supports client-side scripting. The scripting language supported is called WMLScript. WML Extends Interactivity to Cell Phones, Pagers, PDAs
Why WML?? WML is designed to support a range of devices which have the following characteristics: Small display size (relative to conventional personal computers) Limited memory and CPU size Low bandwidth Due to these reasons WAP was designed to be lean and mean
WML Environment To develop WML applications you need- A WAP enabled Web Server: You can enable your Apache or Microsoft IIS to serve all the WAP client request. A WAP Gateway Simulator: This is required to interact to your WAP server. E.g.- Nokia WAP Gateway Simulator A WAP Phone Simulator: This is required to test your WAP Pages and to show all the WAP pages. Eg- Nokia WAP simulator, WinWAP simulator
WML Environment You can write your WAP pages using the following languages: Wireless Markup Language(WML) to develop WAP application. WML Script to enhance the functionality of WAP application.
WML Formatting WML formatting- WML tags Decks and cards Comments Text formatting Tables
WML Formatting WML Tags Syntax: strict, conforms to XML 1.0 standard Restricted use of tags Restricted use of tables and images Tags are case-sensitive
WML Formatting 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 All WML documents MUST have a specific header The Deck is delimited by the... tag
WML Formatting Deck WML page Consists of a set of cards All cards in a deck are downloaded at one time Must be small and contain logically pertaining cards Cards Can contain text, markup, links, input- fields, tasks, images, etc. Can be related to each other with links
WML Formatting Hello… This is my First WML Card Hello… This is my second WML Card Only one card is displayed at a time Result Hello.. This is my First WML Card
WML:Comments Comments are not visible in brower
WML:Table Cell 1 Cell 2 Cell 3
WML:Anchor (Link) Links tag Similar to HTML links text Use # to reference a card (e.g. href = “#myCard”) Otherwise, will go to the first card in a deck A tag: My First link
WML:Anchor (Link) Syntax text Anchor tag: Next page
WML:Image Syntax Anchor tag:
WML: Input Syntax: text
WML: Input Name: Age: Sex: Input Name: Age : Sex :
Specifying a Format Mask A: Any symbolic or uppercase alphabetic character (no numbers) a: Any symbolic or lowercase alphabetic character (no numbers) N: Any numeric character (no symbols or alphabetic characters) X: Any symbolic, numeric, or uppercase alphabetic character (not changeable to lowercase) x: Any symbolic, numeric, or lowercase alphabetic character (not changeable to uppercase) M: Any symbolic, numeric, or uppercase alphabetic character (changeable to lowercase)--for multiple character input, defaults to uppercase first character
Specifying a Format Mask m: Any symbolic, numeric, or lowercase alphabetic character (changeable to uppercase)--for multiple character input, defaults to lowercase first character To limit the number of characters users can enter, you can specify a single digit number before the character tag--for example, format="3X" lets user enter a maximum of three symbolic, numeric, or uppercase alphabetic characters. To let users enter an unlimited number of characters, specify an asterisk (*) before the character tag--for example, format="*a" lets the user enter any number of symbolic or lowercase alphabetic characters.
Select and Option Select Syntax <select title="label" multiple="boolean” name="variable” default="default" iname="index_var” ivalue="default” tabindex="n"> content Option Syntax The element specifies a particular choice within a element. Syntax content
Select and Option HTML School XML School WAP School --- Selectable List 1--- HTML School XML School WAP School
WML Task Go task Prev task Refresh task Noop task
WML Task
WML Task: go The element is a task element that instructs the device to open a specified URL. If the URL specifies a particular card, the device displays that card. If the URL specifies a deck, the device displays the first card in that deck. Syntax: content where content represents the variables to set when opening the specified URL: Content You can optionally specify one or more variables in a statement:
WML Task: go Go To Test
WML Task: prev task The element is a task element that instructs the device to remove the current URL from the history stack and open the previous URL. If no previous URL exists on the history stack, specifying has no effect. Syntax: content where content represents the variables to set when opening the previous URL: content You can optionally specify one or more variables in a statement:
WML Task: prev task Previous Page
WML Task: noop task The element is a task element that instructs the device to do nothing, i.e. "no operation." This element is useful for overriding deck-level elements, called shadowing Syntax:
WML Task: noop task
WML Task: Refresh task The element is a task element that instructs the device to refresh the specified card variables. The device also refreshes the display if any of those variables are currently shown. Syntax: content where content represents the variables to refresh: content You must specify at least one variable in a statement:
WML Task: Refresh task Refresh this page
WML Variable Variables are used to proliferate status information or user entries from one card to another or to the server. Variables consist of a letter or underscore character, followed by zero or more letters, numbers or underscore. WML variables are case sensitive. A WML variable can be specified in various ways: with a setvar command through an input element with a postfield command The major use of variables is for forms.
WML Variable When someone executes a task (like go, prev, and refresh), the setvar element can be used to set a variable with a specified value. Syntax: Example:
WML Template This element behaves like a function that is shared by all the cards of a deck. Syntax: Task Example: