<?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: Mapping multiple tabular columns (source) to a xml loop element in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Mapping-multiple-tabular-columns-source-to-a-xml-loop-element/m-p/2236836#M25449</link>
    <description>Thanks for your reply Shong! 
&lt;BR /&gt;On top of the above requirement, there are millions of (DB)records of that kind of structure. 
&lt;BR /&gt;What would be the fastest approach ?&amp;nbsp; 
&lt;BR /&gt;I tried something like tMySqlInput -&amp;gt;main -&amp;gt; tAdvanceOutputXml(some intermediate xml format based on db columns as elements) then applied tXsl to get the desired format. 
&lt;BR /&gt;But it takes 2 hours of times to complete the job for completing the 300 million records. 
&lt;BR /&gt;I am looking for a better solution. Please guide me.</description>
    <pubDate>Sat, 28 Feb 2015 14:20:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-02-28T14:20:56Z</dc:date>
    <item>
      <title>Mapping multiple tabular columns (source) to a xml loop element</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mapping-multiple-tabular-columns-source-to-a-xml-loop-element/m-p/2236834#M25447</link>
      <description>Hi Team:&lt;BR /&gt;I have a requirement to extract data from database&amp;nbsp;and export to xml. The tricky part is each column name should go to a loop element's attribute in an xml.&lt;BR /&gt;Example :&lt;BR /&gt;Input :&amp;nbsp;&lt;BR /&gt;----------&lt;BR /&gt;Database columns :&lt;BR /&gt;==================&lt;BR /&gt;NAME,SEX,AGE,COUNTRY&lt;BR /&gt;GEORGE,M,61,USA&lt;BR /&gt;CHING,M,45,CHINA&lt;BR /&gt;==================&lt;BR /&gt;Output :&amp;nbsp;&lt;BR /&gt;--------&lt;BR /&gt;XML as below&lt;BR /&gt;&amp;lt;Employees&amp;gt;&lt;BR /&gt;&amp;lt;Employee&amp;gt;&lt;BR /&gt;&amp;lt;Description type="NAME"&amp;gt;George&amp;lt;/Description&amp;gt;&lt;BR /&gt;&amp;lt;Description type="SEX"&amp;gt;M&amp;lt;/Description&amp;gt;&lt;BR /&gt;&amp;lt;Description type="AGE"&amp;gt;61&amp;lt;/Description&amp;gt;&lt;BR /&gt;&amp;lt;Description type="COUNTRY"&amp;gt;USA&amp;lt;/Description&amp;gt;&lt;BR /&gt;&amp;lt;/Employee&amp;gt;&lt;BR /&gt;&amp;lt;Employee&amp;gt;&lt;BR /&gt;&amp;lt;Description type="NAME"&amp;gt;CHING&amp;lt;/Description&amp;gt;&lt;BR /&gt;&amp;lt;Description type="SEX"&amp;gt;M&amp;lt;/Description&amp;gt;&lt;BR /&gt;&amp;lt;Description type="AGE"&amp;gt;45&amp;lt;/Description&amp;gt;&lt;BR /&gt;&amp;lt;Description type="COUNTRY"&amp;gt;CHINA&amp;lt;/Description&amp;gt;&lt;BR /&gt;&amp;lt;/Employee&amp;gt;&lt;BR /&gt;&amp;lt;/Employees&amp;gt;&lt;BR /&gt;Key points:&lt;BR /&gt;1. Based on each record in DB table ,an Employee entity has to be generated in xml.&lt;BR /&gt;2. DB Column name should go to xml Description's attribute "type". Description is a loop element.&lt;BR /&gt;Please advice how to proceed.&lt;BR /&gt;&amp;nbsp;</description>
      <pubDate>Sat, 28 Feb 2015 00:27:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mapping-multiple-tabular-columns-source-to-a-xml-loop-element/m-p/2236834#M25447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-28T00:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping multiple tabular columns (source) to a xml loop element</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mapping-multiple-tabular-columns-source-to-a-xml-loop-element/m-p/2236835#M25448</link>
      <description>Hi&amp;nbsp; 
&lt;BR /&gt;You need to iterate each record and append it to existing XML file. The job looks like: 
&lt;BR /&gt;father job: 
&lt;BR /&gt;tMysqlInput--main--tFlowToIterate--iterate--tRunJob 
&lt;BR /&gt;trunJob: pass current record to child job, and call the child job 
&lt;BR /&gt;child job: 
&lt;BR /&gt;tFixedFlowInput--main--tNormazliedRow--main--tMap--main--tAdvancedFileOutputXML 
&lt;BR /&gt;on tFixedFlowInput: generate the current record passed from father job. 
&lt;BR /&gt;on tNormalizedRow: normalized one row to multiple rows. for example: 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;GEORGE,M,61,USA&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;becomes:&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;GEORGE&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;M&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;61&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;USA&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;on tMap: add a sequence number for each line, add a new column called type in the output table and set its value based the line number, for exmaple:&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;Var.line%4==0?"COUNTRY": (Var.line%4==3?"AGE": (Var.line%4==2?"SEX":"NAME"))&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;tAdvancedFileOutputXML: generate the XML file if current record is the first line, otherwise, append current record to an existing XML file. see 
&lt;BR /&gt; 
&lt;A href="https://help.talend.com/search/all?query=Append+the+source+xml+file+feature&amp;amp;content-lang=en" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/search/all?query=Append+the+source+xml+file+feature&amp;amp;content-lang=en&lt;/A&gt; 
&lt;BR /&gt;BR 
&lt;BR /&gt;Shong</description>
      <pubDate>Sat, 28 Feb 2015 01:58:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mapping-multiple-tabular-columns-source-to-a-xml-loop-element/m-p/2236835#M25448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-28T01:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping multiple tabular columns (source) to a xml loop element</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Mapping-multiple-tabular-columns-source-to-a-xml-loop-element/m-p/2236836#M25449</link>
      <description>Thanks for your reply Shong! 
&lt;BR /&gt;On top of the above requirement, there are millions of (DB)records of that kind of structure. 
&lt;BR /&gt;What would be the fastest approach ?&amp;nbsp; 
&lt;BR /&gt;I tried something like tMySqlInput -&amp;gt;main -&amp;gt; tAdvanceOutputXml(some intermediate xml format based on db columns as elements) then applied tXsl to get the desired format. 
&lt;BR /&gt;But it takes 2 hours of times to complete the job for completing the 300 million records. 
&lt;BR /&gt;I am looking for a better solution. Please guide me.</description>
      <pubDate>Sat, 28 Feb 2015 14:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Mapping-multiple-tabular-columns-source-to-a-xml-loop-element/m-p/2236836#M25449</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-28T14:20:56Z</dc:date>
    </item>
  </channel>
</rss>

