当前位置: 首页 > 网络学院 > XML相关教程 > WAP > <template>

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

WAP 中的 <template>


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

The <template> tag defines a template for all the cards in a deck. The "code" in the <template> tag is added to each card in the deck. 
<template>标签为平台中所有的卡片定义了一套模板。<template>标签中的"code[代码]"将被添加到平台中的每个卡片中。

Note: You can specify only one <template> tag for each deck. 
注意:你仅能为每个平台指定一个<template>标签。

Note: This tag can only contain <do> and <onevent> tags. 
注意:这个标签仅能包含<do> 和 <onevent>标签。

Syntax
语法

<template>
..<do>..
..<onevent>..
</template>

Attributes
属性

属性 描述
onenterbackward url Occurs when the user navigates into a card using a "prev" task
指定浏览前面内容的url
onenterforward url Occurs when the user navigates into a card using a "go" task
指定浏览后面内容的url
ontimer url Occurs when the "timer" expires
指定当“计时器”过期时产生的url
class cdata Sets a class name for the element. The class name is case sensitive. An element can be connected to multiple classes. Multiple class names within the class attribute are separated by white space
为元素设置一个类名称。类名称是字母大小写不敏感的。一个元素可以被连接到多个类中。类属性中的多个类名称是通过空白符进行分隔的
id id Sets a unique name for the element
为元素设置一个独立的名称

Examples
案例

下面的案例通过使用<do>标签将一个“back”连接添加到每个卡片中:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<template> <do type="prev" label="Back"> <prev/> </do>
</template>
<card id="card1" title="Card 1">
<p> <a href="#card2">Go to Card 2</a>
</p>
</card>
<card id="card2" title="Card 2">
<p> <a href="#card3">Go to Card 3</a>
</p>
</card>
<card id="card3" title="Card 3">
<p> Hello RuanChen!
</p>
</card>
</wml> 

评论 (0) All

登陆 | 还没注册?