<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [resolved] talend extract xml field in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-talend-extract-xml-field/m-p/2281837#M56239</link>
    <description>Hey! 
&lt;BR /&gt;I have this job in talend that is suppose to retrieve a field an loop through it. 
&lt;BR /&gt;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: 
&lt;BR /&gt; &amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt; 
&lt;BR /&gt;&amp;lt;empresas&amp;gt; 
&lt;BR /&gt; &amp;lt;empresa&amp;gt; 
&lt;BR /&gt; &amp;lt;imoveis&amp;gt; 
&lt;BR /&gt; &amp;lt;imovel&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;fotos&amp;gt; 
&lt;BR /&gt; &amp;lt;nome id="" order=""&amp;gt;photo1&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; &amp;lt;nome id="" order=""&amp;gt;&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; &amp;lt;nome id="" order=""&amp;gt;&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; &amp;lt;nome id="" order=""&amp;gt;&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; &amp;lt;/fotos&amp;gt; 
&lt;BR /&gt; &amp;lt;/imovel&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;/imovei&amp;gt; 
&lt;BR /&gt; &amp;lt;/empresa&amp;gt; 
&lt;BR /&gt;&amp;lt;/empresas&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Now using the ExtractXml component I am trying to get the "fotos" element. 
&lt;BR /&gt;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. 
&lt;BR /&gt;You can see the 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 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Hope someone can help me out. 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;Notes: I am using talendv4.1.2 on ubuntu 10.10 64bit 
&lt;BR /&gt;EDIT: 
&lt;BR /&gt;Ok I am able to loop through the xml field 
&lt;BR /&gt;I changed the xpath loop query in the file to: 
&lt;BR /&gt;"/empresas/empresa/imoveis/imovel" 
&lt;BR /&gt;and then changed the loop query in the component to: 
&lt;BR /&gt;"/fotos/nome" and in the column xpath I didn't put anything. 
&lt;BR /&gt;The problem is now that I loop 37 times and I get always the same result of the same block with XML 
&lt;BR /&gt;Ex: 
&lt;BR /&gt;&amp;lt;nome id="" ordem=""&amp;gt;photo1.jpg&amp;lt;/nome&amp;gt; 
&lt;BR /&gt;&amp;lt;nome id="" ordem=""&amp;gt;photo1.jpg&amp;lt;/nome&amp;gt; 
&lt;BR /&gt;&amp;lt;nome id="" ordem=""&amp;gt;photo1.jpg&amp;lt;/nome&amp;gt; 
&lt;BR /&gt;&amp;lt;nome id="" ordem=""&amp;gt;photo1.jpg&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Now I just want to retrieve the value of nome and not have it always be the same. What xpath do I have to use!!??? 
&lt;BR /&gt;EDIT2: 
&lt;BR /&gt;Ok I figured it out. I put a "." in the xpath 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Sat, 16 Nov 2024 13:05:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T13:05:37Z</dc:date>
    <item>
      <title>[resolved] talend extract xml field</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-talend-extract-xml-field/m-p/2281837#M56239</link>
      <description>Hey! 
&lt;BR /&gt;I have this job in talend that is suppose to retrieve a field an loop through it. 
&lt;BR /&gt;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: 
&lt;BR /&gt; &amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt; 
&lt;BR /&gt;&amp;lt;empresas&amp;gt; 
&lt;BR /&gt; &amp;lt;empresa&amp;gt; 
&lt;BR /&gt; &amp;lt;imoveis&amp;gt; 
&lt;BR /&gt; &amp;lt;imovel&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;fotos&amp;gt; 
&lt;BR /&gt; &amp;lt;nome id="" order=""&amp;gt;photo1&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; &amp;lt;nome id="" order=""&amp;gt;&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; &amp;lt;nome id="" order=""&amp;gt;&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; &amp;lt;nome id="" order=""&amp;gt;&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; &amp;lt;/fotos&amp;gt; 
&lt;BR /&gt; &amp;lt;/imovel&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt; &amp;lt;/imovei&amp;gt; 
&lt;BR /&gt; &amp;lt;/empresa&amp;gt; 
&lt;BR /&gt;&amp;lt;/empresas&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Now using the ExtractXml component I am trying to get the "fotos" element. 
&lt;BR /&gt;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. 
&lt;BR /&gt;You can see the 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 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Hope someone can help me out. 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;Notes: I am using talendv4.1.2 on ubuntu 10.10 64bit 
&lt;BR /&gt;EDIT: 
&lt;BR /&gt;Ok I am able to loop through the xml field 
&lt;BR /&gt;I changed the xpath loop query in the file to: 
&lt;BR /&gt;"/empresas/empresa/imoveis/imovel" 
&lt;BR /&gt;and then changed the loop query in the component to: 
&lt;BR /&gt;"/fotos/nome" and in the column xpath I didn't put anything. 
&lt;BR /&gt;The problem is now that I loop 37 times and I get always the same result of the same block with XML 
&lt;BR /&gt;Ex: 
&lt;BR /&gt;&amp;lt;nome id="" ordem=""&amp;gt;photo1.jpg&amp;lt;/nome&amp;gt; 
&lt;BR /&gt;&amp;lt;nome id="" ordem=""&amp;gt;photo1.jpg&amp;lt;/nome&amp;gt; 
&lt;BR /&gt;&amp;lt;nome id="" ordem=""&amp;gt;photo1.jpg&amp;lt;/nome&amp;gt; 
&lt;BR /&gt;&amp;lt;nome id="" ordem=""&amp;gt;photo1.jpg&amp;lt;/nome&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Now I just want to retrieve the value of nome and not have it always be the same. What xpath do I have to use!!??? 
&lt;BR /&gt;EDIT2: 
&lt;BR /&gt;Ok I figured it out. I put a "." in the xpath 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Sat, 16 Nov 2024 13:05:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-talend-extract-xml-field/m-p/2281837#M56239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:05:37Z</dc:date>
    </item>
  </channel>
</rss>

