4. WML Features Lost in XHTML MP

Some of the features available in WML 1.x do not exist in XHTML MP any more. In this section, you will learn about these differences between WML 1.x and XHTML MP. This section is particularly useful for those who are familiar with WML 1.x but are new to XHTML MP, or those who want to migrate their mobile Internet application from WML 1.x to XHTML MP.

For some of the WML features lost, there are ways to achieve similar effect in XHTML MP. It should be noted that WAP 2.0 is backward compatible to WML 1.x, which means WAP 2.0 mobile devices can display WML 1.x documents. If there is a WML feature that you must use but is not available in XHTML MP, you can consider developing your WAP application with WML 1.x.

Here are the major WML features lost in XHTML MP:

  1. XHTML MP does not support decks and cards

  2. XHTML MP does not support timers

  3. XHTML MP does not support events

  4. XHTML MP does not support variables

  5. XHTML MP does not support client-side scripting

  6. XHTML MP does not support programmable softkeys

  7. XHTML MP does not support the <u> tag

  8. XHTML MP does not support the format attribute for input fields

  9. XHTML MP does not support posting of data with anchor links


4.1. XHTML MP Does Not Support Decks and Cards

The <deck> and <card> elements of WML do not exist in XHTML MP any more. In WML, a file can contain one or more cards. Together they form a deck. All cards in a deck are downloaded to the wireless device at a time. The WAP browser displays one card each time and you can go to other cards through anchor links. With the use of decks and cards, the number of round-trips to the server is reduced. The performance increase can be significant, since the latency of each request to the server is high for wireless devices.

To achieve similar feature in XHTML MP, you can use multipart messages (multiple documents are put in a single HTTP response). Another way is to make use of target anchors (target anchors are placed at various locations in a page, and links are defined for users to scroll to the target anchors. More details will be mentioned later at "Going to a Location in the Current XHTML MP Page").


4.2. XHTML MP Does Not Support Timers

To create a timer in WML, you use the <timer> tag and the ontimer event. Both the <timer> tag and the ontimer event are not supported in XHTML MP.

To achieve similar functionality in XHTML MP, try HTTP refresh, like this:


...
<head>
...
  <meta http-equiv="refresh" content="10;URL=http://www.developershome.com/" />
...
</head>
...


In the above XHTML MP example, the <meta> element tells the WAP browser to go to the URL "http://www.developershome.com/" after 10 seconds. Note that a WML timer will start only if the user goes to the card in the forward direction, while a HTTP refresh timer starts whenever the user goes to the XHTML MP page.

More details about HTTP refresh will be mentioned later at "Periodic Refresh in XHTML MP".


4.3. XHTML MP Does Not Support Events

Events are not available in XHTML MP. WML supports four events: ontimer, onenterbackward, onenterforward and onpick. As discussed in the previous section, HTTP refresh can simulate the ontimer event. For the other events, there is no alternative in XHTML MP. If the use of them is a must for your mobile Internet browsing application, you have to consider using WML 1.x instead of XHTML MP.


4.4. XHTML MP Does Not Support Variables

In WML, you can declare variables and assign a value to it. WML variables have global scope, which means you can use them in any decks and cards. One common use of variables in WML is to store the data typed by a user so that he/she needs not to type the data again later.

You cannot make use of variables in XHTML MP. The alternative is to put all processing at the server-side. For example, if you want to share the data typed by a user on one XHTML MP page with other XHTML MP pages, the data should be sent to and stored at the server. Later the server can embed the user data in the XHTML MP markup when necessary and send it to the wireless device.


4.5. XHTML MP Does Not Support Client-side Scripting

In WML, you can use a client-side scripting language called WMLScript, which is similar to JavaScript. One common use of WMLScript in WML is to validate data entered by users.

Client-side scripting is not currently available for XHTML MP. The alternative is to put all processing at the server-side. For example, instead of validating user data locally at the wireless device, the user data can be posted to the server for processing. If the user data is of the wrong format, outside the valid range, or is missed in some fields, the server can direct the user to an XHTML MP page to correct the data.

Future mobile devices will support a client-side scripting language called ECMAScript Mobile Profile (ESMP), which is designed to be used with XHTML MP. It supports all WMLScript functionality.


Previous Page Page 4 of 36 Next Page


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page