home

Softsteel Solutions

About Us Contact Us Newsletter Training
Tutorials
 

Lesson 3: Cards and Decks - creating individual pages and groups of pages

In HTML, a single file (myPage.html) will generally correspond to just one viewable page. In WML, however, a single file (myPage.wml) can hold the details of more than one page.

WML makes use of the metaphor of playing-cards to describe this relationship. Each viewable page specified in a WML document is termed a 'card'. And all cards specified in the same WML document are part of the same 'deck'.

The details describing a single card are placed between <card> </card> tags. Cards should be given an identifying name, and can also be given a title. These details are placed within the initial <card> tag like this:

<card id="myIdentifier" title="myTitle">

The identifier attribute is used to distinguish this card from any others in the deck. The title attribute is used by some microbrowsers (as the browsers embedded in mobile phones are called) as a heading for the card.

The following script illustrates the specification for a card named 'card1'. Note that indentation in the script can be used to make it more readable; whitespace in WML documents should be ignored by microbrowsers.

1.

<?xml version="1.0"?>

2.

<!DOCTYPE wml PUBLIC
"-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

3.

<wml>

4.

<card id="card1" title="Welcome">

5.

<!-- This is a Comment -->

6.

</card>

7.

</wml>

As yet card1 contains no viewable content. This content will go where there is currently a comment. As with HTML, any information placed within comment identifiers

<!- anyText -->

will be ignored by the microbrowser.

 

WML Tutorials