xsl元素参考

XSLT 元素参考

W 3C 推荐标准所定义的XSLT元素(XSLT 1.0)。

XSLT元素

 元素列中的链接指向每个特定元素的属性和更多有用的信息。

N: 指明最早版本的Netscape浏览器所支持的标签

IE: 指明最早版本的IE浏览器所支持的标签

注意: IE5支持的元素可能含有非标准的行为,因为在XSLT成为W 3C 的官方推荐标准之前,IE5就已经发布了。

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
条件语句:如果指定的条件为真,则执行对应的模版

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
把结果中的命名空间用样式表中的命名空间替换

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 函数

XQuery 1.0, XPath 2.0, XSLT 2.0共享一个函数库。

XSLT包含了超过100个内置函数,包括字符串函数、数值函数、日期时间函数、节点、QName处理函数、序列处理函数、逻辑函数等等。

XSLT函数命名空间的URI是:http://www.w3.org/2005/02/xpath-functions

函数命名空间的默认前缀是“fn”

提示: 函数的声明通常以“fn” 为前缀,如:“fnstring()”;然而,由于“fn:”是命名空间的默认前缀,因此,当声明函数时,函数名称不需要书写前缀名。

请在我们的XPath教程中查找全部内置的XSLT2.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>元素指定的索引来返回一个节点集

system-property()

Returns the value of the system properties
返回系统属性值

unparsed-entity-uri()

Returns the URI of an unparsed entity
返回一个未被解析的实体元素的URI

 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值