Я ищу выражение XPath для получения содержимого статьи без раздела ссылок. Я хочу, чтобы в разделе статьи было все, пока не появится тег <p>
, внутри которого есть "Ссылки".
//root/main/article/following-sibling::p[.="References"]
<root>
<main>
<article>
<p>
The stunning increase in homelessness announced in Los Angeles
this week — up 16% over last year citywide — was an almost an
incomprehensible conundrum given the nation's booming economy
and the hundreds of millions of dollars that city, county and
state officials have directed toward the problem.
</p>
<p>
"We cannot let a set of difficult numbers discourage us
or weaken our resolve" Garcetti said.
</p>
<p>
References: Maeve Reston, CNN
</p>
</article>
</main>
</root>
Результат, который я ищу, будет следующим.
<p>
The stunning increase in homelessness announced in Los Angeles
this week — up 16% over last year citywide — was an almost an
incomprehensible conundrum given the nation's booming economy
and the hundreds of millions of dollars that city, county and
state officials have directed toward the problem.
</p>
<p>
"We cannot let a set of difficult numbers discourage us
or weaken our resolve" Garcetti said.
</p>