• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Buffer excel data and merge

#1 2008-02-26 14:12:10

ReggieBE
Member
Registered: 1970-01-01
Posts: 13

Buffer excel data and merge

Tags: [java, merge, xml]

Hi,

I need to generate an xml file which has first some hardcoded nodes (like company info etc...) and then a loop with clients.
What's the easiest way to do this ? I'm trying to let a tAdvancedFileOutputXML make the loop, and then merge with another xml file, but I don't know if this is the correct way.

This piece is static:
-------
<VatIntra SenderId='437514441' RecipientId='VAT-ADMIN' SenderDate='2008-02-26' VersionTech='1.2' xsi:schemaLocation='http://www.minfin.fgov.be/VatIntra http://www.minfin.fgov.be/VatIntra/VatIntra-1.0.xsd' xmlns='http://www.minfin.fgov.be/VatIntra' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' MandataireId='' ControlRef='12345678901234'>
    <AgentRepr DecNumber='1'>
        <CompanyInfo>
            <VATNum>0437514441</VATNum>
            <Name>TAPIBEL</Name>
            <Street>INDUSTRIELAAN 4</Street>
            <CityAndZipCode>3900  OVERPELT</CityAndZipCode>
            <Country>BE</Country>
        </CompanyInfo>
    </AgentRepr>
    <DeclarantList DeclarantNum='0437514441000000001' AmountSum='9681866' SequenceNum='1' ClientNbr='4'>
        <CompanyInfo>
            <VATNum>0437514441</VATNum>
            <Name>TAPIBEL</Name>
            <Street>INDUSTRIELAAN 4</Street>
            <CityAndZipCode>3900  OVERPELT</CityAndZipCode>
            <Country>BE</Country>
        </CompanyInfo>
        <Period>42007</Period>
--------
start of loop
        <ClientList SequenceNum='1'>
            <CompanyInfo>
                <VATNum>U19755806</VATNum>
                <Country>AT</Country>
            </CompanyInfo>
            <Period>42007</Period>
            <Amount>83200</Amount>
        </ClientList>
        <ClientList SequenceNum='2'>
            <CompanyInfo>
                <VATNum>U38227502</VATNum>
                <Country>AT</Country>
            </CompanyInfo>
            <Period>42007</Period>
            <Amount>67500</Amount>
        </ClientList>
        <ClientList SequenceNum='3'>
            <CompanyInfo>
                <VATNum>U58319368</VATNum>
                <Country>AT</Country>
            </CompanyInfo>
            <Period>42007</Period>
            <Amount>2524338</Amount>
        </ClientList>
        <ClientList SequenceNum='4'>
            <CompanyInfo>
                <VATNum>175260739</VATNum>
                <Country>BG</Country>
            </CompanyInfo>
            <Period>42007</Period>
            <Amount>7006828</Amount>
        </ClientList>
--------
end of loop
    </DeclarantList>
</VatIntra>

Offline

#2 2008-02-27 07:27:49

shong
Talend team
Registered: 2007-08-29
Posts: 10300
Website

Re: Buffer excel data and merge

Hi

Currently, it is impossible to merge two xml files into one file in Talend.

Best regards

          shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2008-02-27 08:16:07

Volker Brehm
Member
Registered: 2007-04-03
Posts: 1139
Website

Re: Buffer excel data and merge

As a workaround you can create one (or two) files and merge them together.
tFileOutXml -> fileA
tFileOutXml -> fileB

fileA -> tFileInputDelimited (rowseparator=\n, columnseparator=any data which is not in your file)-> tFileOutputDelimited -> fileC
fileA -> tFileInputDelimited (rowseparator=\n, columnseparator=any data which is not in your file)-> tFileOutputDelimited (append) -> fileC

But I've not checked if it is possible to create the xml-output you need as parts. May be you can use header / footer to avoid xml-stuff you do not need (again).

Bye
Volker

Offline

#4 2008-02-27 10:28:29

mhirt
Talend team
Registered: 2006-09-19
Posts: 1638

Re: Buffer excel data and merge

Hello,

The best way is probably to also put your static datas in you schema and use the loop of the tAdvancedFileOuputXML.

Regards,


Uploaded Images

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Buffer excel data and merge

Board footer

Powered by FluxBB