For this HTML / XML:
<div class="contentBlock">
<h2> </h2>
<h1></h1>
<h1>DBS055 - single module packages</h1>
</div>
I want to extract with XPath only DBS055, not the entire text.
For this HTML / XML:
<div class="contentBlock">
<h2> </h2>
<h1></h1>
<h1>DBS055 - single module packages</h1>
</div>
I want to extract with XPath only DBS055, not the entire text.
XPath 2.0
will return all of the first words of the string values of those
h1elements that have a non-space character in their string value.XPath 1.0
approximates the more robust XPath 2.0 solution. Expand
',;/.'as necessary for various characters you consider to define word boundaries.Explanation:
h1that has a non-whitespace-only string value.