<?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: [resolved] Output XML multi loop from unique table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294403#M67289</link>
    <description>Hello mathurm,&lt;BR /&gt;I don't understand your approach.&lt;BR /&gt;tWriteXMLField read an XML file to populate a table.&lt;BR /&gt;&lt;U&gt;My problem is :&lt;/U&gt;&lt;BR /&gt;student table -&amp;gt; ??? -&amp;gt; XML output&lt;BR /&gt;Else I don't well use tWriteXMLField ??&lt;BR /&gt;Thanks,&lt;BR /&gt;Arnaud</description>
    <pubDate>Tue, 23 Sep 2014 14:20:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-09-23T14:20:58Z</dc:date>
    <item>
      <title>[resolved] Output XML multi loop from unique table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294401#M67287</link>
      <description>Hello,&lt;BR /&gt;I would like to generate an XML file with multi loops. The source is just one table.&lt;BR /&gt;&lt;U&gt;Here's my table structure :&lt;/U&gt;&lt;BR /&gt;Student&lt;BR /&gt;Name | Birth | Sex | Driving_licence | Sport1 | Sport2 | Sport3 | Sport4 | Sport5 | Activity1 | Activity2 | Activity3 | Activity4 | Activity5&lt;BR /&gt;&lt;U&gt;And the XML structure :&lt;/U&gt;&lt;BR /&gt;&amp;lt;SCHOOL&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;STUDENTS&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;STUDENT&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;NAME&amp;gt;JOHN DOE&amp;lt;/NAME&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;BIRTH&amp;gt;13-07-1983&amp;lt;/NAISSANCE&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SEX&amp;gt;M&amp;lt;/SEX&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SPORTS&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SPORT&amp;gt;BaseBall&amp;lt;/SPORT&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SPORT&amp;gt;Soccer&amp;lt;/SPORT&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SPORT&amp;gt;Tennis&amp;lt;/SPORT&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/SPORTS&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ACTIVITIES&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ACTIVITY&amp;gt;Library&amp;lt;/ACTIVITY&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ACTIVITY&amp;gt;Cooking&amp;lt;/ACTIVITY&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ACTIVITIES&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DRIVING_LICENCE&amp;gt;8&amp;lt;/DRIVING_LICENCE&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/STUDENT&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;STUDENT&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;NAME&amp;gt;BARBARA SHU&amp;lt;/NAME&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;BIRTH&amp;gt;20-02-1987&amp;lt;/NAISSANCE&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SEX&amp;gt;F&amp;lt;/SEX&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SPORTS&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SPORT&amp;gt;Danse&amp;lt;/SPORT&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SPORT&amp;gt;Tennis&amp;lt;/SPORT&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/SPORTS&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ACTIVITIES&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ACTIVITIES&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DRIVING_LICENCE&amp;gt;8&amp;lt;/DRIVING_LICENCE&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/STUDENT&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/STUDENTS&amp;gt;&lt;BR /&gt;&amp;lt;/SCHOOL&amp;gt;&lt;BR /&gt;I try many solutions but there are not very nice. I have difficulties to apply multi loops in my outputXML. Can you help me ?&lt;BR /&gt;Thanks !!&lt;BR /&gt;Arnaud</description>
      <pubDate>Tue, 23 Sep 2014 12:26:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294401#M67287</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-23T12:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Output XML multi loop from unique table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294402#M67288</link>
      <description>Hi Amaud, 
&lt;BR /&gt;I'm sure you would be trying this using tWriteXMLField component. 
&lt;BR /&gt;My suggestion would be rather than going for a one-time XML creation, go for the below approach: 
&lt;BR /&gt;1. Create &amp;amp; populate all the independent, non-looping elements first; starting from the outer-most element &amp;amp; working your way in. 
&lt;BR /&gt;2. Using separate ETL flow/pipelines create place-holders for all looping elements &amp;amp; populate accordingly 
&lt;BR /&gt;3. ITERATE the above steps for the outer-most looping element i.e. in your case STUDENT. (From the XML structure given, I assume element SCHOOL is not repeating.) 
&lt;BR /&gt;I'm also assuming that normalizing the data is not currently the challenge under discussion. 
&lt;BR /&gt;Hope it helps. 
&lt;BR /&gt;MathurM</description>
      <pubDate>Tue, 23 Sep 2014 13:46:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294402#M67288</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-23T13:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Output XML multi loop from unique table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294403#M67289</link>
      <description>Hello mathurm,&lt;BR /&gt;I don't understand your approach.&lt;BR /&gt;tWriteXMLField read an XML file to populate a table.&lt;BR /&gt;&lt;U&gt;My problem is :&lt;/U&gt;&lt;BR /&gt;student table -&amp;gt; ??? -&amp;gt; XML output&lt;BR /&gt;Else I don't well use tWriteXMLField ??&lt;BR /&gt;Thanks,&lt;BR /&gt;Arnaud</description>
      <pubDate>Tue, 23 Sep 2014 14:20:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294403#M67289</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-23T14:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Output XML multi loop from unique table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294404#M67290</link>
      <description>Hi Arnaud, 
&lt;BR /&gt;Let me be a bit more clearer.... 
&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; 
&lt;BR /&gt;What I intended to say was that instead of creating the complete XML structure in one-go, you should build it part-by-part (SINCE THERE ARE MULTIPLE LOOPING ELEMENTS, &amp;amp; no components support that.) 
&lt;BR /&gt;Also, component tWriteXMLField is employed to write/create an XML structure only. 
&lt;BR /&gt;Try the below approach: 
&lt;BR /&gt;1. Extract STUDENT records iteratively, like 
&lt;BR /&gt;Student table input --&amp;gt; tFlowtoIterate --&amp;gt; tJava (which can link to further sub-jobs on 'onComponentOK' trigger), to process each row one-by-one 
&lt;BR /&gt;2. Then, you can build the following structure using a tWriteXMLField component: 
&lt;BR /&gt;&amp;lt;SCHOOL&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;lt;STUDENTS&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;STUDENT&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;NAME&amp;gt;JOHN DOE&amp;lt;/NAME&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;BIRTH&amp;gt;13-07-1983&amp;lt;/NAISSANCE&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;SEX&amp;gt;M&amp;lt;/SEX&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;DRIVING_LICENCE&amp;gt;8&amp;lt;/DRIVING_LICENCE&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/STUDENT&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;lt;/STUDENTS&amp;gt; 
&lt;BR /&gt;&amp;lt;/SCHOOL&amp;gt; 
&lt;BR /&gt;This can be achieved by extracting required fields &amp;amp; populating them in appropriate place-holders in the tWriteXMLField component. (There won't be any need for normalizing this data) Looping element in tWriteXMLField would be '&amp;lt;STUDENT&amp;gt;'. 
&lt;BR /&gt;Then, save the thus created XML in globalmap, using XMLutils commands. 
&lt;BR /&gt;3. Then, using 2 different pipelines you need to extract the 'SPORTS' &amp;amp; 'ACTIVITIES' data, normalize it, create XML structure like below using tWriteXMLField component &amp;amp; populate it 
&lt;BR /&gt;SPORTS&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;SPORT&amp;gt;BaseBall&amp;lt;/SPORT&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;SPORT&amp;gt;Soccer&amp;lt;/SPORT&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;SPORT&amp;gt;Tennis&amp;lt;/SPORT&amp;gt; 
&lt;BR /&gt;&amp;lt;/SPORTS&amp;gt; 
&lt;BR /&gt;&amp;lt;ACTIVITIES&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ACTIVITY&amp;gt;Library&amp;lt;/ACTIVITY&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ACTIVITY&amp;gt;Cooking&amp;lt;/ACTIVITY&amp;gt; 
&lt;BR /&gt;&amp;lt;/ACTIVITIES&amp;gt; 
&lt;BR /&gt;After creation of each of the above XMLs, merge the SPORTS xml into SCHOOL xml using XMLutils commands. 
&lt;BR /&gt;4. The above process will iterate for each incoming STUDENT record. 
&lt;BR /&gt;5. Once the complete XML is ready, we can then write it to a file using tFileOutputXML or tAdvancedFileOutputXML components, based on your need. 
&lt;BR /&gt;The above is a high-level outlined approach. you may need to fill up the gaps at a couple of places. 
&lt;BR /&gt;MathurM</description>
      <pubDate>Thu, 25 Sep 2014 10:39:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Output-XML-multi-loop-from-unique-table/m-p/2294404#M67290</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-25T10:39:10Z</dc:date>
    </item>
  </channel>
</rss>

