<?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 Re: XPath not working properly in tExtractXMLField / tXMLMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366037#M129573</link>
    <description>No, what I meant was that "/" is wrong. You need to set it to an XPath that points to the looping element. Otherwise only the first value in a series of loops will be returned. This is the correct behaviour.</description>
    <pubDate>Wed, 25 May 2016 12:13:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-25T12:13:45Z</dc:date>
    <item>
      <title>XPath not working properly in tExtractXMLField / tXMLMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366034#M129570</link>
      <description>&lt;P&gt;This is my sample XML&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;shiporder&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;lt;items&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;lt;item&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;Empire Burlesque&amp;lt;/title&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;lt;note&amp;gt;Special Edition&amp;lt;/note&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;lt;quantity&amp;gt;1&amp;lt;/quantity&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;lt;price&amp;gt;10.90&amp;lt;/price&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;lt;/item&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;lt;item&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;Hide your heart&amp;lt;/title&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;lt;quantity&amp;gt;1&amp;lt;/quantity&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;lt;price&amp;gt;9.90&amp;lt;/price&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;lt;/item&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;lt;/items&amp;gt;&lt;BR /&gt;&amp;lt;/shiporder&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;My XPath query doesn't give the expected output , i.e. it should give both the titles whereas its giving the first title only.&lt;BR /&gt;I tried below XPath:&lt;BR /&gt;- //shiporder/items/item[position()&amp;lt;3]/title&lt;BR /&gt;- //title&lt;BR /&gt;&lt;BR /&gt;Shouldn't Talend give proper output for my above XPath strings ?&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MFH9.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140270iBAD921E75B194AE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MFH9.png" alt="0683p000009MFH9.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 10:37:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366034#M129570</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: XPath not working properly in tExtractXMLField / tXMLMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366035#M129571</link>
      <description>If you want data for every title, you need to set the loop xpath. You have set it to "/".</description>
      <pubDate>Tue, 24 May 2016 22:15:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366035#M129571</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-24T22:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: XPath not working properly in tExtractXMLField / tXMLMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366036#M129572</link>
      <description>&lt;BLOCKQUOTE&gt;
  rhall_2.0 wrote: 
 &lt;BR /&gt;If you want data for every title, you need to set the loop xpath. You have set it to "/". 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Yes, the Loop XPath query was already set to "/" . Attached is screenshot of my job 
&lt;BR /&gt;Still it doesn't work as expected. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MFIR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134535iABAA771B593369B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MFIR.png" alt="0683p000009MFIR.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 25 May 2016 02:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366036#M129572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-25T02:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: XPath not working properly in tExtractXMLField / tXMLMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366037#M129573</link>
      <description>No, what I meant was that "/" is wrong. You need to set it to an XPath that points to the looping element. Otherwise only the first value in a series of loops will be returned. This is the correct behaviour.</description>
      <pubDate>Wed, 25 May 2016 12:13:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366037#M129573</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-25T12:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: XPath not working properly in tExtractXMLField / tXMLMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366038#M129574</link>
      <description>Thanks rhall_2.0 
&lt;BR /&gt;I found that when i use these: 
&lt;BR /&gt;[size=1][font=Verdana, Helvetica, Arial, sans-serif]- //shiporder/items/item[position()&amp;lt;3]/title[/font][/size] 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;- //title&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt;in Loop XPath query, and put "." in XPath query, it works as i wanted. But this is putting the Xpath query in the loop section. 
&lt;BR /&gt; 
&lt;BR /&gt;If I simply point to the looping element in Loop Xpath query i.e. set it to //shiporder/items/item (also tried //shiporder/items) and put the //title (or //item/title)&amp;nbsp;in the XPath query, it doesn't work. Is this the expected behaviour ? 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;And to come to what i'm intending to do... 
&lt;BR /&gt;I want to use tExtractXMLField or tXMLMap to convert the input XML as in my first post, to a CSV of the 2 /shiporder/items/item/title fields. So the output CSV should look like: 
&lt;BR /&gt; 
&lt;FONT face="consolas," monaco=""&gt;Empire Burlesque, &lt;/FONT&gt; 
&lt;FONT face="consolas," monaco=""&gt;Hide your heart&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;I found a way to do this using tExtractXMLField with a bit of Java routine, but i think it should be doable by using these 2 components and XPath. Do you think it can be done that way ?</description>
      <pubDate>Wed, 25 May 2016 13:28:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XPath-not-working-properly-in-tExtractXMLField-tXMLMap/m-p/2366038#M129574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-25T13:28:50Z</dc:date>
    </item>
  </channel>
</rss>

