Descriptions of XPath functions
The DB2® XPath functions are a subset of the XPath 2.0 and XQuery 1.0 functions and operators.
These topics provide detailed reference information for the XPath functions that are supported by DB2 for i. Functions can be used anywhere in an XPath expression where an expression is expected. The supported functions are listed in the following tables:
- fn:abs function
The fn:abs function returns the absolute value of a numeric value. - fn:adjust-date-to-timezone function
The fn:adjust-date-to-timezone function adjusts an xs:date value to a specific time zone, or removes the time zone component from the value. - fn:adjust-dateTime-to-timezone function
The fn:adjust-dateTime-to-timezone function adjusts an xs:dateTime value to a specific time zone, or removes the time zone component from the value. - fn:adjust-time-to-timezone function
The fn:adjust-time-to-timezone function adjusts an xs:time value to a specific time zone, or removes the time zone component from the value. - fn:boolean function
The fn:boolean function returns the effective boolean value of a sequence. - fn:compare function
The fn:compare function compares two strings. - fn:concat function
The fn:concat function concatenates two or more strings into a single string. - fn:contains function
The fn:contains function determines whether a string contains a given substring. - fn:count function
The fn:count function returns the number of values in a sequence. - fn:current-date function
The fn:current-date function returns the current date in the implicit timezone of UTC. - fn:current-dateTime function
The fn:current-dateTime function returns the current date and time in the implicit timezone of UTC. - db2-fn:current-local-date function
The db2-fn:current-local-date function returns the current date in the local time zone. - db2-fn:current-local-dateTime function
The db2-fn:current-local-dateTime function returns the current date and time in the local time zone. - db2-fn:current-local-time function
The db2-fn:current-local-time function returns the current time in the local time zone. - fn:current-time function
The fn:current-time function returns the current time in the implicit timezone of UTC. - fn:data function
The fn:data function converts a sequence of items to a sequence of atomic values. - fn:dateTime function
The fn:dateTime function constructs an xs:dateTime value from an xs:date value and an xs:time value. - fn:day-from-date function
The fn:day-from-date function returns the day component of an xs:date value that is in its localized form. - fn:day-from-dateTime function
The fn:day-from-dateTime function returns the day component of an xs:dateTime value that is in its localized form. - fn:days-from-duration function
The fn:days-from-duration function returns the days component of a duration. - fn:distinct-values function
The fn:distinct-values function returns the distinct values in a sequence. - fn:exists function
The fn:exists function can check for the existence of many different types of items, such as elements, attributes, text nodes, atomic values (for example, an integer), or XML documents. If the expression specified as its argument produces an empty result (the empty sequence), then fn:exists returns false. If the argument returns anything but the empty sequence, then fn:exists returns true. - fn:hours-from-dateTime function
The fn:hours-from-dateTime function returns the hours component of an xs:dateTime value that is in its localized form. - fn:hours-from-duration function
The fn:hours-from-duration function returns the hours component of a duration value. - fn:hours-from-time function
The fn:hours-from-time function returns the hours component of an xs:time value that is in its localized form. - fn:implicit-timezone function
The fn:implicit-timezone function returns the time zone that is used when a date, time, or dateTime value that does not have a time zone is used in a comparison or arithmetic operation. - fn:last function
The fn:last function returns the number of values in the sequence of items that is currently being processed. - fn:local-name function
The fn:local-name function returns the local name property of a node. - db2-fn:local-timezone function
The db2-fn:local-timezone function returns the time zone of the local system. - fn:lower-case function
The fn:lower-case function converts a string to lowercase. - fn:matches function
The fn:matches function determines whether a string matches a given pattern. - fn:max function
The fn:max function returns the maximum of the values in a sequence. - fn:min function
The fn:min function returns the minimum of the values in a sequence. - fn:minutes-from-dateTime function
The fn:minutes-from-dateTime function returns the minutes component of an xs:dateTime value that is in its localized form. - fn:minutes-from-duration function
The fn:minutes-from-duration function returns the minutes component of a duration. - fn:minutes-from-time function
The fn:minutes-from-time function returns the minutes component of an xs:time value that is in its localized form. - fn:month-from-date function
The fn:month-from-date function returns the month component of a xs:date value that is in its localized form. - fn:month-from-dateTime function
The fn:month-from-dateTime function returns the month component of an xs:dateTime value that is in its localized form. - fn:months-from-duration function
The fn:months-from-duration function returns the months component of a duration value. - fn:name function
The fn:name function returns the prefix and local name parts of a node name. - fn:normalize-space function
The fn:normalize-space function strips leading and trailing whitespace characters from a string and replaces multiple consecutive whitespace characters in the string with a single blank character. - fn:not function
The fn:not function returns false if the effective boolean value of a sequence expression is true. fn:not returns true if the effective boolean value of a sequence expression is false. - fn:position function
The fn:position function returns the position of the context item in the sequence that is currently being processed. - fn:replace function
The fn:replace function compares each set of characters within a string to a given pattern. fn:replace replaces the characters that match the pattern with another set of characters. - fn:round function
The fn:round function returns the integer that is closest to the specified numeric value. - fn:seconds-from-dateTime function
The fn:seconds-from-dateTime function returns the seconds component of an xs:dateTime value that is in its localized form. - fn:seconds-from-duration function
The fn:seconds-from-duration function returns the seconds component of a duration. - fn:seconds-from-time function
The fn:seconds-from-time function returns the seconds component of an xs:time value that is in its localized form. - fn:starts-with function
The fn:starts-with function determines whether a string begins with a given substring. The substring is matched using the default collation. - fn:string function
The fn:string function returns the string representation of a value. - fn:string-length function
The fn:string-length function returns the length of a string. - fn:substring function
The fn:substring function returns a substring of a string. - fn:sum function
The fn:sum function returns the sum of the values in a sequence. - fn:timezone-from-date function
The fn:timezone-from-date function returns the time zone component of an xs:date value. - fn:timezone-from-dateTime function
The fn:timezone-from-dateTime function returns the time zone component of an xs:dateTime value. - fn:timezone-from-time function
The fn:timezone-from-time function returns the time zone component of an xs:time value. - fn:tokenize function
The fn:tokenize function breaks a string into a sequence of substrings. - fn:translate function
The fn:translate function replaces selected characters in a string with replacement characters. - fn:upper-case function
The fn:upper-case function converts a string to uppercase. - fn:year-from-date function
The fn:year-from-date function returns the year component of an xs:date value that is in its localized form. - fn:year-from-dateTime function
The fn:year-from-dateTime function returns the year component of an xs:dateTime value that is in its localized form. - fn:years-from-duration function
The fn:years-from-duration function returns the years component of a duration.
Parent topic: Overview of XPath