You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

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
Hi
Currently, it is impossible to merge two xml files into one file in Talend.
Best regards
shong
Offline

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
Pages: 1