title: Talend tExtractXMLField
body: <p>I have this job in Talend that is supposed to retrieve a field and loop through it.</p>
  
  <p>My big problem is that the code is looping through the XML fields but it's returning null. 
  Here is a sample of the XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;empresas&gt;
      &lt;empresa&gt;
          &lt;imoveis&gt;
              &lt;imovel&gt;
                  [-- some fields --  ]
  
                  &lt;fotos&gt;
                      &lt;nome id="" order=""&gt;photo1&lt;/nome&gt;
                      &lt;nome id="" order=""&gt;&lt;/nome&gt;
                      &lt;nome id="" order=""&gt;&lt;/nome&gt;
                      &lt;nome id="" order=""&gt;&lt;/nome&gt;
                  &lt;/fotos&gt;
              &lt;/imovel&gt;
              [ -- other entries here -- ]
          &lt;/imoveis&gt;
      &lt;/empresa&gt;
  &lt;/empresas&gt;
  </code></pre>
  
  <p>Now using the tExtractXMLField component I am trying to get the "fotos" element.
  Here is what I have in the component:
  <img src="https://i.stack.imgur.com/0jZsr.png" alt="enter image description here"></p>
  
  <p>I have tried to change the XPath query and the XPath loop query but the result is either I don't loop through the field or I get the null in the value field in the tMap.</p>
  
  <p>Here is an image of the job:</p>
  
  <p><img src="https://i.stack.imgur.com/zTceh.png" alt="enter image description here"></p>
  
  <p>You can see that I have retrieved 4 items from the XML but what I get is null in the "nome" field. There must be something wrong with the XPath but I can't seem to find the problem :(</p>
  
  <p>Hope someone can help me out. Thanks
  Notes: I am using talendv4.1.2 on ubuntu 10.10 64bit</p>