The Card... Don't leave home without it.


© Wai Seto

In the last article, we have looked at how to create a simple WML page. It is a very good start. Following up the last article, I will continue to introduce the WML framework. In this article and a few that follow, we will look at how elements in WML make up the decks and cards framework.

As we have talked about, a WML page is called a deck. Each deck is made up of one or more cards. The analogy will be like a poker deck that contains many cards. The reason for this design is because of the limited screen size of mobile devices. Each card can be thought of as a display unit.

Document header
As we have mentioned in the last article, WML is a subset of XML. Each valid XML document contains a declaration and a document type declaration. The same is true for WML deck. The following is an example what the header should look like:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

This header identifies the version number of XML and WML. The above statements note the document is using WML version 1.1. In normal cases, one can copy the above lines and put into a WML page.

Wml element
We come to the first and most important element of WML. Every WML document has this element. If you know HTML, this element is similar to the <html> tag. The WML element encloses the all the information of cards in the deck. The following is an example of how to use the WML element. In this example, we have an optional attribute. The attribute in this example specifies the natural or formal language of the document.
<wml xml:lang="en-us">
...
</wml>
Keep in mind that without the above option; the statement is still valid as follow:
<wml>
...
</wml>

Card element
The card element indicates the general layout of the information and input fields. We have mentioned that Cards are small display units; however, there is no restriction on hardware vendors to have to display all elements in a card on one screen. Hardware vendors can choose to display different elements of a card in a series of screens. Inside a card, different input fields, and text make up the card contents, much like HTML pages. Each card has an 'id' element; this 'id' can be used in a URL as a fragment anchor.

Card element attributes:
'title=' Indicate the card title
'newcontext=boolean' This attribute indicates upon entering the deck the WML browser should reset its state to a new state. All pervious contexts should be destroyed.

Go To Page: 1 2


The copyright of the article The Card... Don't leave home without it. in Wireless Internet is owned by Wai Seto. Permission to republish The Card... Don't leave home without it. in print or online must be granted by the author in writing.

Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo