现在的位置: 首页 > 综合 > 正文

XSLT参考

2012年03月20日 ⁄ 综合 ⁄ 共 3917字 ⁄ 字号 评论关闭
<原文路径:http://c.lstc.edu.cn:8090/kj/Manfeel/w3pop/default-5.asp.htm>

一、XSLT元素参考

 来自W3C参考标准所定义(XSLT版本1.0)的XSLT元素。

“元素”列中的链接指出每个特殊元素的属性和更多有用的信息。

  • N: 指出Netscape最早版本的支持标签。
  • IE: 指出最早的支持标签的IE版本。

注意: 在IE5中被支持的元素可能含有非标准的行为(NON-standard behavior),因为IE5在XSLT成为W3C的官方参考标准之前就已经发布了。

Element
元素
Description
描述
IE N
apply-imports Applies a template rule from an imported style sheet
应用输入样式表的模版规则
6.0  
apply-templates Applies a template rule to the current element or to the current element's child nodes
把模版规则应用到当前元素或当前元素的子元素
5.0 6.0
attribute Adds an attribute
添加属性
5.0 6.0
attribute-set Defines a named set of attributes
定义指定属性
6.0 6.0
call-template Calls a named template
调用指定模版
6.0 6.0
choose Used in conjunction with <when> and <otherwise> to express multiple conditional tests
通过与<when> 和<otherwise>配合使用来表达多种条件测试
5.0 6.0
comment Creates a comment node in the result tree
在结果树中创建一个注释节点
5.0 6.0
copy Creates a copy of the current node (without child nodes and attributes)
复制正确节点(不需要子节点和属性)
5.0 6.0
copy-of Creates a copy of the current node (with child nodes and attributes)
复制正确节点(需要子节点和属性)
6.0 6.0
decimal-format Defines the characters and symbols to be used when converting numbers into strings, with the format-number() function
定义字符和符号(在通过format-number() 函数,把数字转换成字符的情况下)
6.0  
element Creates an element node in the output document
在输出文档中创建一个元素节点
5.0 6.0
fallback Specifies an alternate code to run if  the processor does not support an XSLT element
如果处理器不支持XSLT元素,则运行指定的预备代码
6.0  
for-each Loops through each node in a specified node set
在指定的节点设置中通过每个节点做循环
5.0 6.0
if Contains a template that will be applied only if a specified condition is true
包含一个只当指定条件为true时才应用的模版
5.0 6.0
import Imports the contents of one style sheet into another. Note: An imported style sheet has lower precedence than the importing style sheet
把一个样式表内容输入到另外一个样式表去。注意:与已输入的样式表相比,正在输入的样式表更具有优先权。
6.0 6.0
include Includes the contents of one style sheet into another. Note: An included style sheet has the same precedence as the including style sheet
把一份样式表的内容嵌到另一份中去 。注意:这两份样式表有相同的优先级。
6.0 6.0
key Declares a named key that can be used in the style sheet with the key() function
通过key() 函数,声明可以用于样式表的指定键
6.0 6.0
message Writes a message to the output (used to report errors)
编写信息到输出(用于报告错误)
6.0 6.0
namespace-alias Replaces a namespace in the style sheet to a different namespace in the output
在样式表中把命名空间(namespace)替换成一个不同的命名空间输出
6.0  
number Determines the integer position of the current node and formats a number
确定当前节点和格式数字的整形位置
6.0 6.0
otherwise Specifies a default action for the <choose> element
指定<choose>元素的错误行为
5.0 6.0
output Defines the format of the output document
定义输出文件的格式
6.0 6.0
param Declares a local or global parameter
声明本地或是全球的参数
6.0 6.0
preserve-space Defines the elements for which white space should be preserved
定义储存空白页的元素
6.0 6.0
processing-instruction Writes a processing instruction to the output
编写输出的处理结构
5.0 6.0
sort Sorts the output
分类输出
6.0 6.0
strip-space Defines the elements for which white space should be removed
定义移除空白页的元素
6.0 6.0
stylesheet Defines the root element of a style sheet
定义样式表的根元素
5.0 6.0
template Rules to apply when a specified node is matched
当指定节点匹配时应用的规则
5.0 6.0
text Writes literal text to the output
编写文字文本到输出
5.0 6.0
transform Defines the root element of a style sheet
定义样式表的根元素
6.0 6.0
value-of Extracts the value of a selected node
摘取选定节点值
5.0 6.0
variable Declares a local or global variable
定义本地或全球变量
6.0 6.0
when Specifies an action for the <choose> element
指定<choose>元素的行为
5.0 6.0
with-param Defines the value of a parameter to be passed into a template
定义模版内的参数值
6.0 6.0

二、XSLT函数参考

 XSLT包含了超过100个内置函数。有些是为了字符串值,数字值,数据和时间比较关系,节点和OName操作,序列操作,布尔(逻辑)值,以及更多。
 XQuery 1.0, XPath 2.0, 和XSLT 2.0共享一个函数库。 另外,还有下面的内置XSLT函数:

Name
名称
Description
描述
current() Returns the current node
返回当前节点
document() Used to access the nodes in an external XML document
用来访问一个外部的XML文档内的节点
element-available() Tests whether the element specified is supported by the XSLT processor
测试指定的元素是否被XSLT处理器支持
format-number() Converts a number into a string
将数字转化为字符串
function-available() Tests whether the function specified is supported by the XSLT processor
测试指定的函数是否被XSLT处理器支持
generate-id() Returns a string value that uniquely identifies a specified node
返回一个独立地定义一个指定节点的字符串值
key() Returns a node-set using the index specified by an <xsl:key> element
使用由<xsl:key>元素指定的索引来返回一个节点设置(node-set)
system-property() Returns the value of the system properties
返回系统属性值
unparsed-entity-uri() Returns the URI of an unparsed entity
返回一个未被解析的URI实体

 

抱歉!评论已关闭.