Luixv
Luixv

Reputation: 8710

Xpath expression with breaks in the middle

I have the following code

<tr>
 <td>
  F10_12-03_R1200
  <br/>
  v01.00_Vorgelegt
</td>
</tr>

which i have to access using Xpath. I've tried using

 .//tr/td[contains(text(), 'F10_12-03_R1200')]

Which works but also matches other nodes. When trying

 .//tr/td[contains(text(), 'F10_12-03_R1200') and contains(text(), 'v01.00_Vorgelegt')]

nonthing is coming.

Any hint?

Thanks!

Upvotes: 2

Views: 102

Answers (1)

Mark Veenstra
Mark Veenstra

Reputation: 4739

When I change your XPath too:

.//tr/td[contains(., 'F10_12-03_R1200') and contains(., 'v01.00_Vorgelegt')]

It outputs the desired output in Altova XML Spy. I have tested it.

See next screenshot: http://i929.photobucket.com/albums/ad134/markdark81/xpath.png

Upvotes: 1

Related Questions