XPath contains a function library for converting data.
The XPath function library contains a set of core functions for converting
and translating data.
Name |
Description |
Example & Result |
concat() |
Returns the concatenation of its arguments |
concat('The',' ','XML') Result:
'The XML' |
contains() |
Returns true if the first string contains the second string, otherwise it
returns false |
contains('XML','X')
Result: true
|
normalize-space() |
Removes leading and trailing spaces from a string |
normalize-space(' The XML') Result:
'The XML' |
starts-with() |
Returns true if the first string starts with the second string, otherwise it
returns false |
starts-with('XML','X') Result: true |
string() |
Converts an object to a string |
string(3.14) Result:
'3,14' |
string-length() |
Returns the number of characters in a string |
string-length('Beatles') Result: 7 |
substring() |
Returns a substring |
substring('Beatles',1,4) Result:
'Beat' |
substring-after() |
Returns a substring after a substring |
substring-after('12/10','/')
Result: '10'
|
substring-before() |
Returns a substring before a substring |
substring-before('12/10','/') Result:
'12' |
translate() |
Translate letters in a string |
translate('12:30',':','!') Result:
'12!30' |
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.