Functions provided by XPath 1.0 that can be used in XSL mappings
Arguments within [squared brackets] are optional.
Node-set Functions
|
count(node-set) |
Returns an integer number with the number of nodes in |
|
|
id (Id) |
Selects the node with the unique ID specified in |
|
|
last () |
Returns an integer number with the position number of the last node in the current context.
|
|
|
local-name ([node-set]) |
Returns a string with the local part of a node name with namespace declaration. The optional argument |
|
|
name ([node-set]) |
Returns a string with the name of the current node. The optional argument |
|
|
namespace-uri ([node-set]) |
Returns a string with the namespace URI (Uniform Resource Identifier) of the current element or attribute node. The optional argument |
|
|
position () |
Returns an integer number with the position of the current node. The first node has the position number |
|
Boolean Functions
Boolean XPath functions return true/false values and can be combined with logical operators.
|
boolean (Arg) |
Checks if argument |
|
|
false () |
Returns |
|
|
lang (Arg) |
Returns |
|
|
not (Arg) |
Returns the negation of a boolean expression in argument |
|
|
true () |
Returns |
|
Number Functions
XPath number functions return integer numbers and can be combined with logical operators.
|
ceiling (Arg) |
Rounds up a number within the argument |
|
|
floor (Arg) |
Rounds down a number within the |
|
|
number ([Arg]) |
Converts the current node's content into a number and returns this number. Optionally, the argument |
|
|
round (Arg) |
Rounds a number within the argument |
|
|
sum (node-set) |
Creates the total sum of all node contents of the argument |
|
String Functions
XPath string functions handle objects and return strings or boolean values when evaluating strings.
|
concat (Arg1,
|
Joins multiple strings that are handed over as arguments |
|
|
contains (Arg, Substring) |
Checks if the argument |
|
|
starts-with (Arg,
|
Checks if the argument |
|
|
normalize-space ([Arg]) |
Removes leading and trailing whitespaces of the current node content, replaces multiple whitespaces, tabulators and line breaks with a single whitespace, and returns the node content as string. Optionally, an argument |
|
|
string ([Arg]) |
Converts the current node content into a string and returns this string. Optionally, the argument Example: Check if the value is a number: |
|
|
string-length ([Arg]) |
Returns an integer number with the number of characters of the current node content. If necessary, all arguments will be converted to a string first. Optionally, an argument |
|
|
substring (Arg, Start, [length]) |
Extracts a substring of the argument |
|
|
substring-before (Arg, Substring) |
Checks if a string in argument |
|
|
substring-after (Arg, Substring) |
Checks if a string in argument |
|
|
translate (Arg, Substring1,
|
Searches in argument |
|