Main menu:

 

August 2008
M T W T F S S
« Jul   Sep »
 123
45678910
11121314151617
18192021222324
25262728293031

Site search

Archives

Categories

Tags

Links:

XPath String Operators and Functions

XPath 1.0 have many string functions:

concat(string string1, string string2, …)— This function returns all strings you pass to it concatenated (that is, joined) together.

contains(string string1, string string2)— This function returns true if the first string contains the second one.

normalize-space(string string1)— This function returns string1 after leading and trailing whitespace is stripped and multiple consecutive whitespace is replaced with a single space.

starts-with(string string1, string string2)— This function returns true if the first string starts with the second string.

string(string string1)— Returns the argument you pass to it in string form.

string-length(string string1)— This function returns the number of characters in string1.

substring(string string1, number offset, number length)— This function returns length characters from the string, starting at offset.

substring-after(string string1, string string2)— This function returns the part of string1 after the first occurrence of string2.

substring-before(string string1, string string2)— This function returns the part of string1 up to the first occurrence of string2.

translate(string string1, string string2, string string3)— This function returns string1 with all occurrences of the characters that occur in string2 replaced by corresponding characters (that is, characters that occur at the same location) in string3.

Write a comment





Currently you have JavaScript disabled. In order to post comments, please make sure JavaScript and Cookies are enabled, and reload the page.