One possible way:
//Heading[starts-with(., 'Ethical') and ends-with(., 'consent')]
The ends-with()
function is XPath 2.0. In XPath 1.0, it can be replaced using substring()
and string-length()
. Here is the equivalent XPath 1.0 (wrapped for readability):
//Heading[
starts-with(., 'Ethical')
and
'consent' = substring(., string-length(.) - string-length('consent') +1)
]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…