当前位置: 首页 > 网络学院 > XML相关教程 > WAP > WML 格式化

WAP
WAP 介绍
WAP 基础知识
WML 格式化
WML 链接
WML Input
WML 任务
WML 计时器
WML 变量
WML 实例
Validate WML
WML 参考
WML 字符实体
WML DTD

WAP 中的 WML 格式化


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 611 ::
收藏到网摘: n/a

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. 
WML页面常常叫做"decks"(一幅card).一副card包含了一组“card”。card (“card”)元素可以包含文本,标记,链接,输入区域,任务,图像等等。“cardcard”之间以链接相连。

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:
在手机上访问WML页面时,页面里所有的卡都从WAP服务器上下载下了。Card和card之间的转换是通过手机内置的手机计算机完成的,无须经过服务器。

<?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 MIGHT look like this in your mobile phone display (note that only one card is displayed at a time):
手机显示的结果也许会是这样(注意一次只显示一张card):

 ------ Card 1 ------ Hello World!


Paragraphs and Line Breaks
段落和行分隔符(Paragraphs and Line Breaks)

A WML card can be set up to display the paragraph and line break functions of WML:
WML的“card“可设置来显示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 MIGHT look like this in your mobile phone display:
手机显示的结果也许会使这样:

 ------ 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:
WMLcard可通过设置显示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 MIGHT look like this in your mobile phone display (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:
WMLcard可通过设置显示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 MIGHT look like this in your mobile phone display:
手机显示的结果也许会是这样

 ------ Table ------
Cell 1 Cell 2 Cell 3

评论 (0) All

登陆 | 还没注册?