<ArticleBackmatter>
<Heading>Ethical standards and patient consent</Heading>
<Heading>Ethical standards and patient</Heading>
<Heading>standards and patient consent</Heading>
</ArticleBackmatter>
I want to get the inner text with start from "Ethical" , contains "and " and end with "consent" in the Heading node.
One possible way:
The
ends-with()
function is XPath 2.0. In XPath 1.0, it can be replaced usingsubstring()
andstring-length()
. Here is the equivalent XPath 1.0 (wrapped for readability):