当前位置: 首页 > 图文教程 > XML家族 > XSLT > XSLT函数
XSLT includes over 100 built-in functions. There are functions for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, Boolean values, and more.
XSLT包含了超过100个内置函数。有些是为了字符串值,数字值,数据和时间比较关系,节点和OName操作,序列操作,布尔(逻辑)值,以及更多。
The URI of the XSLT function namespace is:http://www.w3.org/2005/02/xpath-functions
XSLT函数命名空间的URI是http://www.w3.org/2005/02/xpath-functions
The default prefix for the function namespace is fn:.
函数命名空间的默认前缀是“fn”:
Tip: Functions are often called with the fn: prefix, such as fn:string(). However, since fn: is the default prefix of the namespace, the function names do not need to be prefixed when called.
提示: 函数经常用“fn”命名:前缀,就像“fn:string()”;当然,自“fn:”后,是命名空间(namespace)的默认前缀,但当被访问时,函数名称不需要前缀。
The reference of all the built-in XSLT 2.0 functions is located in our XPath tutorial.
在XSLT2.0 函数中所有内置的参数都在我们XPath教程里面。
In addition, there are the following built-in XSLT functions:
另外,还有下面的内置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实体 |
评论 (0) All