XSLT and XPath function reference in alphabetical order

(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 5, translated from German)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


The following overview contains all functions defined in the scope of XSLT 2.0 and XPath 2.0 in alphabetical order.

When following the respective link, each described function is assigned to a category and the origin (XSLT/XPath 1.0 or 2.0) is indicated. Then, the return value of the function as well as the number and type of the arguments expected for the call are described. The purpose of use of the individual function is explained and demonstrated by means of various examples. The signatures of the function are indicated in the form of a function definition, where possible, the definitions of the versions are compared.

The XPath functions include the fn: prefix, the XSLT functions have no prefix.


fn:abs() absolute value of the input number
fn:adjust-date-to-timezone() adjusts a date to a timezone
fn:adjust-dateTime-to-timezone() adjusts a point of time to a timezone
fn:adjust-time-to-timezone() adjusts a daytime to a timezone
fn:avg() average of input values
  to the top


fn:base-uri() accessor; base URI of a node
fn:boolean() conversion into a Boolean value (true or false)
  to the top


fn:ceiling() rounding up of the input number
fn:codepoint-equal() Unicode codepoint comparison
fn:codepoints-to-string() Unicode codepoint conversion into string
fn:collection() sequence of several document nodes from the input string
fn:compare() test of two strings for equality
fn:concat() string addition
fn:contains() checks whether the string of the second argument is a substring of the first argument
fn:count() number of nodes in the nodeset
current() the current node
fn:current-date() the current date
fn:current-dateTime() the current date and daytime
current-group() the current group of a grouping
current-grouping-key() the current grouping key
fn:current-time() the current daytime
  to the top


fn:data() converts the input sequence into atomic values
fn:dateTime() constructor for timestamp values
fn:day-from-date() day from date
fn:day-from-dateTime() day from point of time
fn:days-from-duration() days from duration
fn:deep-equal() determines the equality of two sequences
fn:default-collation() URI of the default collation
fn:distinct-values() removes indentical values from a sequence
fn:doc() embedding of exactly one external document (without base URI)
fn:doc-available() testing for availability of an external document
document() embedding of one or more external documents (with base URI)
fn:document-uri() URI of the related document node of a node passed on
  to the top


element-available() availability of an instruction
fn:empty() returns true for an empty sequence
fn:encode-for-uri() encodes certain characters of a string which are reserved for other purposes or which are not permitted in an URI
fn:ends-with() test for substring at the end of the string
fn:error() error output
fn:escape-html-uri() escapes the URI string
fn:exactly-one() returns the input sequence of exactly one item, otherwise an error occurs
fn:exists() returns true for a non-empty sequence
  to the top


fn:false() Boolean value false
fn:floor() rounding down of the input number
format-date() formats the date to a string
format-dateTime() formats a point in time to a string
format-number() formats a number to a string
format-time() formats a daytime to a string
function-available() availability of a function
  to the top


generate-id() generating ID at runtime
  to the top


fn:hours-from-dateTime() hours from point of time
fn:hours-from-duration() hours from duration
fn:hours-from-time() hours from daytime
  to the top


fn:id() returns a sequence of nodes with an ID value passed on
fn:idref() sequence of nodes with an IDREF value passed on
fn:implicit-timezone() the implicit timezone
fn:in-scope-prefixes() returns prefixes of valid namespaces
fn:index-of() returns the index(es) of the item(s) with the comparative value passed on
fn:insert-before() inserts item(s) into the sequence to the position passed on
fn:iri-to-uri() converting IRI string into URI string
  to the top


key() defining a node with defined key
  to the top


fn:lang() language determination (now XPath core function)
fn:last() the index of the last node in the set
fn:local-name() local part of a QName
fn:local-name-from-QName() extracts the local identifier as string
fn:lower-case() conversion into lower case letters
  to the top


fn:matches() test for pattern matching
fn:max() maximum of input values
fn:min() minimum of input values
fn:minutes-from-dateTime() minutes from point of time
fn:minutes-from-duration() minutes from duration
fn:minutes-from-time() minutes from daytime
fn:month-from-date() month from date
fn:month-from-dateTime() month from point of time
fn:months-from-duration() months from duration
  to the top


fn:name() QName of a node (backward compartible)
fn:namespace-uri() namespace URI of a node
fn:namespace-uri-for-prefix() namespace URI of the prefix passed on
fn:namespace-uri-from-QName() extracts the namespace URI of a QName
fn:nilled() accessor; reports the nilled condition of an element node as Boolean value
fn:node-name() expanded QName of a node
fn:normalize-space() normalises whitespace
fn:normalize-unicode() returns the Unicode normal form
fn:not() Boolean negation
fn:number() conversion into a number
  to the top


fn:one-or-more() returns the input sequence of one or more items, otherwise an error occurs
  to the top


fn:position() the index of the current node in the set
fn:prefix-from-QName() returns the prefix of the namespace
  to the top


fn:QName() constructor; returns the QName
  to the top


regex-group() the current group of the result of a regular expression
fn:remove() removes the item from the sequence at the indicated position
fn:replace() replacing with pattern matching
fn:resolve-QName() constructor; converts a string into an expanded QName
fn:resolve-uri() resolves the relative URI indication with the base URI
fn:reverse() returns an input sequence in reversed order
fn:root() root node with regard to the tree of an input node
fn:round() rounding up or down of the input number
fn:round-half-to-even() rounding with variable precision
  to the top


fn:seconds-from-dateTime() seconds from point of time
fn:seconds-from-duration() seconds from duration
fn:seconds-from-time() seconds from daytime
fn:starts-with() test for substring at the beginning of the string
fn:static-base-uri() the base URI of the static context
fn:string() conversion into a string
fn:string-join() joins strings with the separator passed on
fn:string-length() number of characters in the test string
fn:string-to-codepoints() string conversion into Unicode codepoints
fn:subsequence() generates a subsequence by means of index numbers passed on
fn:substring() extraction of a substring
fn:substring-after() substring after the separator
fn:substring-before() substring before the separator
fn:sum() addition of values of a nodeset
system-property() reading out the system properties of the runtime environment
  to the top


fn:timezone-from-date() timezone from date
fn:timezone-from-dateTime() timezone from point of time
fn:timezone-from-time() timezone from daytime
fn:tokenize() splits the input string by means of pattern matching
fn:trace() keeping a debugging log file
fn:translate() replaces a string by a pattern
fn:true() Boolean value true
type-available() availability of a schema type
  to the top


fn:unordered() allows any output order of a sequence
unparsed-entity-public-id() public ID of an unparsed, external entity
unparsed-entity-uri() URI of an unparsed, external entity (DTD)
unparsed-text() embedding an external, unparsed text
unparsed-text-available() tests for availability of an external text object
fn:upper-case() conversion into upper case letters
  to the top


fn:year-from-date() year from date
fn:year-from-dateTime() year from point of time
fn:years-from-duration() years from duration
  to the top


fn:zero-or-one() returns the input sequence of zero or one item, otherwise an error occurs
  to the top


<< back next >>




Copyright © Galileo Press, Bonn 2008
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSLT 2.0 & XPath 2.0" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

Galileo Press, Rheinwerkallee 4, 53227 Bonn, Germany