TIP:
This function is also underspecified in the XPointer candidate
recommendation. In particular, it is not clear what happens when
there are overlapping matches.
You can also specify an offset
and a length to the function so that strings start a certain number
of characters from the beginning of the match and continue for a
specified number of characters. The point before the first character
in the string to search is 1. For example, this XPointer selects the
first four characters after the word
"Wizard" in
title elements:
xpointer(string-range(//title, "Wizard", 7, 4))
Nonpositive indices work backwards in the document before the
beginning of the match. For example, this XPointer selects the first
four characters before the word
"Wizard" in
title elements: