Optimisation of access from small, limited devices: WAP-enabled devices are generally small and battery operated and they have relatively limited memory and CPU power. So WML2 should be optimized enough to run on these devices.

Allowance for the creation of distinct user interfaces: WAP enables the creation of Man Machine Interfaces (MMIs) with maximum flexibility and ability for a vendor to enhance the user experience.

Internationalisation of the architecture: WAP targets common character codes for international use. This includes international symbols and pictogram sets for end users, and local-use character encoding for content developers.

WML2 Vision:

The WML2 vision is to create a language that extends the syntax and semantics of XHTML Basic and CSS Mobile profile with the unique semantics of WML1. The user should not be aware of how WML1 compatibility is achieved.

The WML2 Language Structure:

WML2 is a new language with the following components:

(1) XHTML Basic:

This element group is for W3C convergence. For some of the elements, WML extension attributes are added in
order to achieve WML1 functionality.

(1a) XHTML Basic elements:

(1b) XHTML Basic elements with WML extension attributes:

body html img input meta option p select style textarea

(2) XHTML Modularization elements:

This element group consists of select elements from those modules of XHTML not included in XHTML Basic. Most elements are included for WML1 compatibility. One element is included as an enhancement that fits limited handset capabilities.

(3a) WML extensions elements (for WML1 compatibility):

(3b) WML extensions elements (for feature enhancement):

wml:widget

WML Document Structure Modules:

The following elements in the Structure Module are used to specify the structure of a WML2 document:

body

html

wml:card

head

title

The body Element:

The wml:newcontext attribute specifies whether the browser context is initialised to a well-defined state when the
document is loaded. If the wml:newcontext attribute value is "true", the browser MUST reinitialise the browser
context upon navigation to this card.

The html Element:

The xmlns:wml attribute refers to the WML namespace for example : http://www.wapforum.org/2001/wml.

The wml:use-xml-fragments attribute is used to specify how a fragment identifier is interpreted by the user agent. For details of use of wml:use-xml-fragments in the go task and the prev task.

The wml:card Element:

The wml:card element specifies a fragment of the document body. Multiple wml:card elements may appear in a single document. Each wml:card element represents an individual presentation and/or interaction with the user.

If the wml:card element's newcontext attribute value is "true", the browser MUST reinitialise the browser context upon navigation to this card.

The head Element:

This element keeps header information of the document like meta element and style sheet etc.

The title Element:

This element is used to put a document title

NOTE: WML developers can use the XHTML document style, that is, body structure, or they can use a collection of cards. When the body structure is used, a document is constructed using a body element. The body element contains the content of the document. When a collection of cards is used, a document is constructed using one or more wml:card elements.

WML2 Tasks

The following tasks are defined in WML2.0. These tasks are very similar to WML1.0

The go task

The prev task

The noop task

The refresh task

WML2 Events:

The following event types are defined in WML2:

Intrinsic event: An event generated by the user agent and includes the following events similar to WML1.0

ontimer

onenterforward

onenterbackward

onpick

Extrinsic event: An event sent to the user agent by some external agent. The WML 2 specification does not specify any classes of extrinsic events. One example of a WML extrinsic event class may be WTA events

WML2 Document Type:

WML2 documents are identified by the MIME media type "application/wml+xml". The type "application/xhtml+xml" can be used to identify documents from any of the XHTML-based markup languages, including XHTML Basic.

The DOCTYPE declaration may include the XHTML Basic Formal Public Identifier and may also include the URI of the XHTML Basic DTD as specified below: