title: jmeter xpath locate element through text and parent
body: <p>I get a xml and want to extract the value of one element by XPath Extractor, however it returns "Assertion failure message: -1" in jmeter.</p>
  
  <pre><code>&lt;flag&gt;
      &lt;sample&gt;123&lt;/sample&gt;
      &lt;others&gt;...&lt;/others&gt;
      &lt;target&gt;a test sample&lt;/target&gt;
  &lt;/flag&gt;
  &lt;flag&gt;
      &lt;sample&gt;1234&lt;/sample&gt;
      &lt;others&gt;...&lt;/others&gt;
      &lt;target&gt;a test sample&lt;/target&gt;
  &lt;/flag&gt;
  </code></pre>
  
  <p>In order to get the text of element <code>&lt;target&gt;</code> where the <code>&lt;sample&gt;</code> is 123, several ways have been tried but failed:</p>
  
  <ul>
  <li><code>//flag[sample='123']/target</code></li>
  <li><code>//sample[.='123']/../target</code></li>
  <li><code>//sample[@value='123']/../target/@value</code></li>
  <li><code>//sample[text()='123']/../target/text()</code></li>
  </ul>
  
  <p>Is there a way to capture the value of element <code>&lt;target&gt;</code>?</p>