I have three samples of text nodes that and I want to extract three different parts of the text, using a universal x-path.
First
<p class="product-summary">
This is an amazing game from the company Midway Games. Excellent gameplay. Very good game.
</p>
Second
<p class="product-summary">
New Line Cinema distributed this movie in 1995.
</p>
Third
<p class="product-summary">
New game from 2011, with new 3D graphics. This game was made by NetherRealm Studios.
</p>
The extraction should be either Midway Games
or New Line Cinema
or NetherRealm Studios
Note that the text node allways include just one company, never two or three (just one).
My try is from this question but the problem is that it dosen't work nor include all three companies.
substring('Midway Games',1,12*contains(//p[@class='product-summary']/following-sibling::text()[1], 'Midway Games'))