XSLT Functions
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, such as fn:string(). However, since fn: is the default prefix of the namespace, the function name does not need a prefix when called.
You can access the reference 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 an external XML document. |
| element-available() | Checks whether the XSLT processor supports a specified element. |
| format-number() | Converts a number into a string. |
| function-available() | Checks whether the XSLT processor supports a specified function. |
| generate-id() | Returns a string value that uniquely identifies a specified node. |
| key() | Returns a node-set by using the xsl:key index number specified by the element. |
| system-property() | Returns the value of a system property. |
| unparsed-entity-uri() | Returns the URI of an unparsed entity. |