XSLT Function
XQuery 1.0, XPath 2.0, and XSLT 2.0 share the same function library.
XSLT Functions
XSLT contains more than 100 built-in functions. These functions are used for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, boolean values, and so on.
The default prefix for the function namespace is fn.
The URI of the function namespace is:
http://www.w3.org/2005/xpath-functions
Tip:Functions are often called with the fn: prefix, for example fn:string(). However, since fn: is the default prefix of the namespace, the function name does not need to use the prefix when called.
You can access the reference manual for all built-in XSLT 2.0 functions in our XPath tutorial.
In addition, the built-in XSLT functions are listed below:
| Name | Description |
|---|---|
| current() | Returns the current node. |
| document() | Used to access nodes in external XML documents. |
| element-available() | Detects whether the XSLT processor supports the specified element. |
| format-number() | Converts a number to a string. |
| function-available() | Detects whether the XSLT processor supports the specified function. |
| generate-id() | Returns the string value that uniquely identifies the specified node. |
| key() | Returns a node set by using the index number specified by the <xsl:key> element. |
| system-property() | Returns the value of a system property. |
| unparsed-entity-uri() | Returns the URI of an unparsed entity. |
Other extensions