title: Extract correct parent attribute value by XPath in Kettle / Spoon
body: <p>I've the following XML and use kettle spoon <strong>Get XML Data</strong> to extract:</p>
  
  <pre><code>&lt;Company cname="ABC"&gt;
  &lt;Staffs&gt;
      &lt;Manager mname="John"&gt;
          &lt;Subordinate sname="Apple"&gt;
              &lt;PhoneNo&gt;11111111&lt;/PhoneNo&gt;
          &lt;/Subordinate&gt;
          &lt;Subordinate sname="Becky"&gt;
              &lt;PhoneNo&gt;22222222&lt;/PhoneNo&gt;
          &lt;/Subordinate&gt;
      &lt;/Manager&gt;
      &lt;Manager mname="Peter"&gt;
          &lt;Subordinate sname="Cathy"&gt;
              &lt;PhoneNo&gt;33333333&lt;/PhoneNo&gt;
          &lt;/Subordinate&gt;
          &lt;Subordinate sname="Doris"&gt;
              &lt;PhoneNo&gt;44444444&lt;/PhoneNo&gt;
          &lt;/Subordinate&gt;
      &lt;/Manager&gt;
  &lt;/Staffs&gt;
  &lt;/Company&gt;
  </code></pre>
  
  <p>If I set the <strong>Loop XPath</strong> as <strong>/Company/Staffs/Manager/Subordinate</strong> , I got the incorrect Manager name <strong>(all managers are John!)</strong>.</p>
  
  <pre><code>Mname: ../../*[name()='Manager']/@*[name()='mname']
  Sname: @*[name()='sname']
  PhoneNo: *[name()='PhoneNo']
  
  |#|Mname|Sname|PhoneNo |
  |-+-----+-----+--------|
  |1|John |Apple|11111111|
  |2|John |Becky|22222222|
  |3|John |Cathy|33333333|
  |4|John |Doris|44444444|
  </code></pre>
  
  <p>Please help, how to get the correct manager name?</p>
  
  <pre><code>------------------------
  |#|Mname|Sname|PhoneNo |
  |-+-----+-----+--------|
  |1|John |Apple|11111111|
  |2|John |Becky|22222222|
  |3|Peter|Cathy|33333333|
  |4|Peter|Doris|44444444|
  ------------------------
  </code></pre>