WML Formatting
Decks and Cards
WML pages are often called "decks". A deck contains a set of cards. A card element can contain text, markup, links, input-fields, tasks, images and
more. Cards can be related to each other with links.
When a WML page is accessed from a mobile phone, all the cards in the page are downloaded from the WAP server.
Navigation between the cards is done by the phone computer - inside the phone - without any extra access trips to the server:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="no1" title="Card 1">
<p>Hello World!</p>
</card>
<card id="no2" title="Card 2">
<p>Welcome to our WAP Tutorial!</p>
</card>
</wml> |
The result will look something like this in a mobile phone (note that only one card is displayed at a time):
------ Card 1 ------
Hello World!
|
Paragraphs and Line Breaks
A WML card can be set up to display the paragraph and line break functions of WML:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="Paragraphs">
<p>This is a paragraph</p>
<p>This is another<br/>with a line break</p>
</card>
</wml> |
The result will look something like this in a mobile phone:
------ Paragraphs ------
This is a paragraph
This is another
with a line break
|
Text Formatting
A WML card can be set up to display the text formatting functions of WML:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="Formatting">
<p>
normal<br/>
<em>emphasized</em><br/>
<strong>strong</strong><br/>
<b>bold</b><br/>
<i>italic</i><br/>
<u>underline</u><br/>
<big>big</big><br/>
<small>small</small>
</p>
</card>
</wml> |
The result will look something like this in a mobile phone (don't take it for granted that all formatting tags will render as expected):
----- Formatting -----
normal
emphasized
strong
bold
italic
underline
big
small
|
Tables
A WML card can be set up to display the table functions of WML:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="Table">
<p>
<table columns="3">
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
</tr>
</table>
</p>
</card>
</wml> |
The result will look something like this in a mobile phone:
------ Table ------
Cell 1 Cell 2 Cell 3
|
Create a free Flash website with our simple, online web design editing platform. Stunning templates
and user-friendly tools make website building easy and fun.
Start Creating your free website now!

Need an easy way to get data into XML, or transform XML to another format?
MapForce lets you map XML data to/from any combination of XML, database, flat file,
Excel 2007, XBRL, or Web services data. Then it transforms data instantly or
auto-generates royalty-free code for recurrent conversions.
New features in Version 2010!
- Easy-to-use, graphical data mapping interface
- Instant data transformation
- XSLT 1.0/2.0 and XQuery code generation
- Java, C#, and C++ code generation
- Advanced data processing functions
- Support for all major relational databases including SQL Server, IBM DB2, Oracle, and more
- Visual Studio & Eclipse integration
- Available in 32-bit and 64-bit versions
Download a fully-functional trial today!
|
|
|
|