<?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: tFileInputXML - Multi loops for several nodes in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340965#M108951</link>
    <description>Hi 
&lt;BR /&gt;It is impossible to achieve this request with only one tFileInputXML, as a workaround, you can use three tFileInputXML components to extract respectively different element, for example, use one tFileInputXML to origine element with xpath loop expression: 
&lt;BR /&gt;/document/etab/accueil_Internes/origine 
&lt;BR /&gt;and then, add a sequence id for each row, and do a join on tMap to merge all columns, for more details, please read my screenshots. 
&lt;BR /&gt; 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009METP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127799iB64D957325F514EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009METP.png" alt="0683p000009METP.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEYh.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155380i13EDEFCB2AF94EA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEYh.png" alt="0683p000009MEYh.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MECy.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143632i435E25A05B111909/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MECy.png" alt="0683p000009MECy.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEQR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154234i29ED034C9606F5C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEQR.png" alt="0683p000009MEQR.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Fri, 24 May 2013 14:54:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-05-24T14:54:14Z</dc:date>
    <item>
      <title>tFileInputXML - Multi loops for several nodes</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340964#M108950</link>
      <description>Hi everyone, 
&lt;BR /&gt;I have an issue with the use of the component tFileInputXML which I would like to use to fill a database table. 
&lt;BR /&gt;My XML file looks like this : 
&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt; 
&lt;BR /&gt;&amp;lt;document&amp;gt; 
&lt;BR /&gt; &amp;lt;etab&amp;gt; 
&lt;BR /&gt; &amp;lt;UAI&amp;gt; 
&lt;BR /&gt; &amp;lt;codeEtab&amp;gt;0300026R&amp;lt;/codeEtab&amp;gt; 
&lt;BR /&gt; &amp;lt;/UAI&amp;gt; 
&lt;BR /&gt; &amp;lt;accueil_Internes&amp;gt; 
&lt;BR /&gt; &amp;lt;origine&amp;gt;0300023M&amp;lt;/origine&amp;gt; 
&lt;BR /&gt; &amp;lt;accueil&amp;gt;0300026R&amp;lt;/accueil&amp;gt; 
&lt;BR /&gt; &amp;lt;effectif&amp;gt;1&amp;lt;/effectif&amp;gt; 
&lt;BR /&gt; &amp;lt;origine&amp;gt;0300026R&amp;lt;/origine&amp;gt; 
&lt;BR /&gt; &amp;lt;accueil&amp;gt;0300026R&amp;lt;/accueil&amp;gt; 
&lt;BR /&gt; &amp;lt;effectif&amp;gt;153&amp;lt;/effectif&amp;gt; 
&lt;BR /&gt; &amp;lt;origine&amp;gt;0300027S&amp;lt;/origine&amp;gt; 
&lt;BR /&gt; &amp;lt;accueil&amp;gt;0300026R&amp;lt;/accueil&amp;gt; 
&lt;BR /&gt; &amp;lt;effectif&amp;gt;18&amp;lt;/effectif&amp;gt; 
&lt;BR /&gt; &amp;lt;origine&amp;gt;0301685U&amp;lt;/origine&amp;gt; 
&lt;BR /&gt; &amp;lt;accueil&amp;gt;0300026R&amp;lt;/accueil&amp;gt; 
&lt;BR /&gt; &amp;lt;effectif&amp;gt;21&amp;lt;/effectif&amp;gt; 
&lt;BR /&gt; &amp;lt;/accueil_Internes&amp;gt; 
&lt;BR /&gt; &amp;lt;/etab&amp;gt; 
&lt;BR /&gt;&amp;lt;/document&amp;gt; 
&lt;BR /&gt;And the schema of my table is like : 
&lt;BR /&gt;UAI char(8), origine char(8), accueil char(8), effectif numeric (the first three fields are my PK). 
&lt;BR /&gt;What I would like to see in my table is four records like : 
&lt;BR /&gt; UAI | origine | accueil | effectif 
&lt;BR /&gt;0300026R | 0300023M | 0300026R | 1 
&lt;BR /&gt;0300026R | 0300026R | 0300026R | 153 
&lt;BR /&gt;0300026R | 0300027S | 0300026R | 18 
&lt;BR /&gt;0300026R | 0301685U | 0300026R | 21 
&lt;BR /&gt;But when I use the component tFileInputXML, I'm only able to retrieve the first line, then it moves on the next etab record. 
&lt;BR /&gt;The job itsefl is simple but I can't find how to do multi-loops in the component for each node (and keeping the same value of UAI, of course...). 
&lt;BR /&gt;Thank for your help ! 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEYc.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140601iE65DA0582164A269/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEYc.jpg" alt="0683p000009MEYc.jpg" /&gt;&lt;/span&gt;</description>
      <pubDate>Thu, 23 May 2013 11:33:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340964#M108950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-23T11:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputXML - Multi loops for several nodes</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340965#M108951</link>
      <description>Hi 
&lt;BR /&gt;It is impossible to achieve this request with only one tFileInputXML, as a workaround, you can use three tFileInputXML components to extract respectively different element, for example, use one tFileInputXML to origine element with xpath loop expression: 
&lt;BR /&gt;/document/etab/accueil_Internes/origine 
&lt;BR /&gt;and then, add a sequence id for each row, and do a join on tMap to merge all columns, for more details, please read my screenshots. 
&lt;BR /&gt; 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009METP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127799iB64D957325F514EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009METP.png" alt="0683p000009METP.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEYh.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155380i13EDEFCB2AF94EA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEYh.png" alt="0683p000009MEYh.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MECy.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143632i435E25A05B111909/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MECy.png" alt="0683p000009MECy.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEQR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154234i29ED034C9606F5C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEQR.png" alt="0683p000009MEQR.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 24 May 2013 14:54:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340965#M108951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-24T14:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputXML - Multi loops for several nodes</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340966#M108952</link>
      <description>hi ,&lt;BR /&gt;if xml file is as below&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR /&gt;&amp;lt;document&amp;gt;&lt;BR /&gt;    &amp;lt;etab&amp;gt;&lt;BR /&gt;        &amp;lt;UAI&amp;gt;&lt;BR /&gt;            &amp;lt;codeEtab&amp;gt;0300026R&amp;lt;/codeEtab&amp;gt;&lt;BR /&gt;            &amp;lt;codeEtab&amp;gt;0300345E&amp;lt;/codeEtab&amp;gt;&lt;BR /&gt;            &amp;lt;codeEtab&amp;gt;03002349T&amp;lt;/codeEtab&amp;gt;&lt;BR /&gt;        &amp;lt;/UAI&amp;gt;&lt;BR /&gt;        &amp;lt;accueil_Internes&amp;gt;&lt;BR /&gt;            &amp;lt;origine&amp;gt;0300023M&amp;lt;/origine&amp;gt;&lt;BR /&gt;            &amp;lt;accueil&amp;gt;0300026R&amp;lt;/accueil&amp;gt;&lt;BR /&gt;            &amp;lt;effectif&amp;gt;1&amp;lt;/effectif&amp;gt;&lt;BR /&gt;            &amp;lt;origine&amp;gt;0300026R&amp;lt;/origine&amp;gt;&lt;BR /&gt;            &amp;lt;accueil&amp;gt;0300026R&amp;lt;/accueil&amp;gt;&lt;BR /&gt;            &amp;lt;effectif&amp;gt;153&amp;lt;/effectif&amp;gt;&lt;BR /&gt;            &amp;lt;origine&amp;gt;0300027S&amp;lt;/origine&amp;gt;&lt;BR /&gt;            &amp;lt;accueil&amp;gt;0300026R&amp;lt;/accueil&amp;gt;&lt;BR /&gt;            &amp;lt;effectif&amp;gt;18&amp;lt;/effectif&amp;gt;&lt;BR /&gt;            &amp;lt;origine&amp;gt;0301685U&amp;lt;/origine&amp;gt;&lt;BR /&gt;            &amp;lt;accueil&amp;gt;0300026R&amp;lt;/accueil&amp;gt;&lt;BR /&gt;            &amp;lt;effectif&amp;gt;21&amp;lt;/effectif&amp;gt;&lt;BR /&gt;        &amp;lt;/accueil_Internes&amp;gt;&lt;BR /&gt;    &amp;lt;/etab&amp;gt;&lt;BR /&gt;&amp;lt;/document&amp;gt;&lt;BR /&gt;&lt;BR /&gt;how to store the details of it in database table</description>
      <pubDate>Wed, 29 May 2013 12:04:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340966#M108952</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-05-29T12:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputXML - Multi loops for several nodes</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340967#M108953</link>
      <description>Thank you Shong, 
&lt;BR /&gt; 
&lt;BR /&gt;it's like what I've done (I use calculated ids from the xml file to merge my data, more like : "count(./preceding::*)"), but I though there might be something more "elegant"... 
&lt;BR /&gt;The ids' count might work for you Manjuvani. 
&lt;BR /&gt;If your file have a regular structure, you can calculate the id for each element, then use a tMap to merge your data. 
&lt;BR /&gt;But what kind of records do you want to have at the end ? 
&lt;BR /&gt;In my case, this was a bit easier because I kept &amp;lt;codeEtab&amp;gt; as key and I knew that the difference between the element origine and accueil was 1. 
&lt;BR /&gt;So the id for &amp;lt;origine&amp;gt; is "count(./preceding::*)" and for &amp;lt;accueil&amp;gt;, it's like "count(./preceding::*)-1" so they can match in the tMap using these two fields. 
&lt;BR /&gt;Even if it's not a clean solution, it works ! 
&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>Wed, 29 May 2013 17:00:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340967#M108953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-05-29T17:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputXML - Multi loops for several nodes</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340968#M108954</link>
      <description>Thanks for the solution ...</description>
      <pubDate>Thu, 30 May 2013 05:57:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340968#M108954</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-05-30T05:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputXML - Multi loops for several nodes</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340969#M108955</link>
      <description>@hotline_crlr 
&lt;BR /&gt;You can do it with one tFileInputXML, looping on /document/etab/accueil_Internes//* to get a row for each origine, accueil and effectif. Use the following three expressions for the columns UAI, field and value: 
&lt;BR /&gt;../../UAI/codeEtab 
&lt;BR /&gt;name() 
&lt;BR /&gt;. 
&lt;BR /&gt;Then add a sequence number from 0 to each row and divide by 3 to create a group ID for each set of three values. Then tPivotToColumnsDelimited for your final result as a file, which you can insert into your DB.</description>
      <pubDate>Thu, 30 May 2013 09:21:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340969#M108955</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-05-30T09:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputXML - Multi loops for several nodes</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340970#M108956</link>
      <description>hi alvey,&lt;BR /&gt;can u describe the job with screen shots please.......</description>
      <pubDate>Mon, 03 Jun 2013 05:48:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputXML-Multi-loops-for-several-nodes/m-p/2340970#M108956</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-06-03T05:48:40Z</dc:date>
    </item>
  </channel>
</rss>

