To select all text nodes following in the document:
//text()[contains(., 'DividerText:')]//following::text()
To select all sibling text nodes (following on the same level inside a wrapping element:
//text()[contains(., 'DividerText:')]//following-sibling::text()
If there is some text you need directly after, you would need XPath 2.0, this query also returns the part after the divider string, but needs the substring-after
function that is not available in XPath 1.0:
//text()[contains(., 'DividerText:')]//(substring-after(., 'DividerText:'), following::text()/data())
If you're able to use XPath 2.0 or newer, there actually is an substring-after
method:
substring-after(string-join(//text()), 'DividerText:')
You could also use //text()
to fetch all text nodes and then use some substring-after()
equivalent in C#, you might have to concatenate the resulting set/array.