4. WML Features Lost
in XHTML MP
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
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.
are the major WML features lost in XHTML MP:
MP does not support decks and cards
MP does not support timers
MP does not support events
MP does not support variables
MP does not support client-side scripting
MP does not support programmable softkeys
MP does not support the <u> tag
MP does not support the format attribute for input fields
MP does not support posting of data with anchor links
4.1. XHTML MP Does Not
Support Decks and Cards
<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.
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
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.
achieve similar functionality in XHTML MP, try HTTP refresh, like
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.
details about HTTP refresh will be mentioned later at "Periodic
Refresh in XHTML MP".
4.3. XHTML MP Does Not
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
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
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
WML, you can use a client-side scripting language called WMLScript,
to validate data entered by users.
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
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.
Feedback Form (ExpandCollapse