XSLT 元素参考
W 3C 推荐标准所定义的XSLT元素(XSLT 1.0)。
XSLT元素
“元素”列中的链接指向每个特定元素的属性和更多有用的信息。
N: 指明最早版本的Netscape浏览器所支持的标签
IE: 指明最早版本的IE浏览器所支持的标签
注意: IE5支持的元素可能含有非标准的行为,因为在XSLT成为W 3C 的官方推荐标准之前,IE5就已经发布了。
Element | Description | IE | N |
Applies a template rule from an imported style sheet | 6.0 |
| |
Applies a template rule to the current element or to the current element's child nodes | 5.0 | 6.0 | |
Adds an attribute | 5.0 | 6.0 | |
Defines a named set of attributes | 6.0 | 6.0 | |
Calls a named template | 6.0 | 6.0 | |
Used in conjunction with <when> and <otherwise> to express multiple conditional tests | 5.0 | 6.0 | |
Creates a comment node in the result tree | 5.0 | 6.0 | |
Creates a copy of the current node (without child nodes and attributes) | 5.0 | 6.0 | |
Creates a copy of the current node (with child nodes and attributes) | 6.0 | 6.0 | |
Defines the characters and symbols to be used when converting numbers into strings, with the format-number() function | 6.0 |
| |
Creates an element node in the output document | 5.0 | 6.0 | |
Specifies an alternate code to run if the processor does not support an XSLT element | 6.0 |
| |
Loops through each node in a specified node set | 5.0 | 6.0 | |
Contains a template that will be applied only if a specified condition is true | 5.0 | 6.0 | |
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 | |
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 | |
Declares a named key that can be used in the style sheet with the key() function | 6.0 | 6.0 | |
Writes a message to the output (used to report errors) | 6.0 | 6.0 | |
Replaces a namespace in the style sheet to a different namespace in the output | 6.0 |
| |
Determines the integer position of the current node and formats a number | 6.0 | 6.0 | |
Specifies a default action for the <choose> element | 5.0 | 6.0 | |
Defines the format of the output document | 6.0 | 6.0 | |
Declares a local or global parameter | 6.0 | 6.0 | |
Defines the elements for which white space should be preserved | 6.0 | 6.0 | |
Writes a processing instruction to the output | 5.0 | 6.0 | |
Sorts the output | 6.0 | 6.0 | |
Defines the elements for which white space should be removed | 6.0 | 6.0 | |
Defines the root element of a style sheet | 5.0 | 6.0 | |
Rules to apply when a specified node is matched | 5.0 | 6.0 | |
Writes literal text to the output | 5.0 | 6.0 | |
Defines the root element of a style sheet | 6.0 | 6.0 | |
Extracts the value of a selected node | 5.0 | 6.0 | |
Declares a local or global variable | 6.0 | 6.0 | |
Specifies an action for the <choose> element | 5.0 | 6.0 | |
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” 为前缀,如:“fn:string()”;然而,由于“fn:”是命名空间的默认前缀,因此,当声明函数时,函数名称不需要书写前缀名。
请在我们的XPath教程中查找全部内置的XSLT2.0函数的参数
作为补充,我们还例举了下面这些内置XSLT函数:
Name | Description |
Returns the current node | |
Used to access the nodes in an external XML document | |
Tests whether the element specified is supported by the XSLT processor | |
Converts a number into a string | |
Tests whether the function specified is supported by the XSLT processor | |
Returns a string value that uniquely identifies a specified node | |
Returns a node-set using the index specified by an <xsl:key> element | |
Returns the value of the system properties | |
Returns the URI of an unparsed entity |