XPATH: Find a piece of text anywhere in the document
2 answers
This XPath,
contains(/,'keyword')
will return true if keyword
contained anywhere in the document string value.
Note that this may or may not match substrings concatenated between elements (i.e. <r>key<b>word</b></r>
), which may or may not be desired. If this is not desired see @ har07's answer (+1).
See also: Testing text () Nodes and String Values ββin XPath
+1
source to share