
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Merging Two xml files
Hi,
I need to output the following xml (<personnes> are referenced in <roles>)
<?xml version="1.0" encoding="ISO-8859-15"?>
<data>
<destinataire oneattribute="blabla"/> <personnes> <personne ID_personne="Contrat_1_personne1" anotherattribute="X"/> <personne ID_personne="Contrat_2_personne1" anotherattribute="Y"/> <personne ID_personne="Contrat_2_personne2" anotherattribute="Z"/> </personnes> <contrats> <contrat ID_contrat="Contrat_1" num_contrat="Contrat_1Num" ref_ID_produit="Fonds" ref_ID_conseiller="conseillerToto"> <roles> <role ref_ID_personne="Contrat_1_personne1" code_role="S"/> </roles> <support_composants> <support_composant ID_support_composant="Produit A" ref_ID_support_info_generale="ISIN_Produit A"/> <support_composant ID_support_composant="Produit B" ref_ID_support_info_generale="ISIN_Produit B"/> </support_composants> </contrat> <contrat ID_contrat="Contrat_2" num_contrat="Contrat_2Num" ref_ID_produit="Fonds" ref_ID_conseiller="conseillerToto"> <roles> <role ref_ID_personne="Contrat_2_personne2" code_role="S"/> <role ref_ID_personne="Contrat_2_personne1" code_role="S"/> </roles> <support_composants> <support_composant ID_support_composant="Produit A" ref_ID_support_info_generale="ISIN_Produit A"/> <support_composant ID_support_composant="Produit B" ref_ID_support_info_generale="ISIN_Produit B"/> <support_composant ID_support_composant="Produit C" ref_ID_support_info_generale="ISIN_Produit C"/> </support_composants> </contrat>
</contrats>
</data>
I have no difficulties to generate independantly or combined in the same input all the nodes in rows but I am struggling to generate the output.
I tried several solutions using tMaps, tXMLMaps (with lookups) + tFileOutputXML but cannot achieve my aim.
One of the last I have tried was to generate two different xml for <role> and <support_composant> :
<?xml version="1.0" encoding="ISO-8859-15"?> <contrats> <contrat ID_contrat="Contrat_1" num_contrat="Contrat_1Num" ref_ID_produit="Fonds" ref_ID_conseiller="conseillerToto"> <roles> <role ref_ID_personne="Contrat_1_personne1" code_role="S"/> </roles> </contrat> <contrat ID_contrat="Contrat_2" num_contrat="Contrat_2Num" ref_ID_produit="Fonds" ref_ID_conseiller="conseillerToto"> <roles> <role ref_ID_personne="Contrat_2_personne2" code_role="S"/> <role ref_ID_personne="Contrat_2_personne1" code_role="S"/> </roles> </contrat> </contrats>
<?xml version="1.0" encoding="ISO-8859-15"?> <contrats> <contrat ID_contrat="Contrat_1" num_contrat="Contrat_1Num" ref_ID_produit="Fonds" ref_ID_conseiller="conseillerToto"> <support_composants> <support_composant ID_support_composant="Produit A" ref_ID_support_info_generale="ISIN_Produit A"/> <support_composant ID_support_composant="Produit B" ref_ID_support_info_generale="ISIN_Produit B"/> </support_composants> </contrat> <contrat ID_contrat="Contrat_2" num_contrat="Contrat_2Num" ref_ID_produit="Fonds" ref_ID_conseiller="conseillerToto"> <support_composants> <support_composant ID_support_composant="Produit A" ref_ID_support_info_generale="ISIN_Produit A"/> <support_composant ID_support_composant="Produit B" ref_ID_support_info_generale="ISIN_Produit B"/> <support_composant ID_support_composant="Produit C" ref_ID_support_info_generale="ISIN_Produit C"/> </support_composants> </contrat> </contrats>
And I cannot mix them, I think I'm losing myself in the loops and grouping features...
Anyone has a clue?
Thanks
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Here is a 'append the source xml file' feature on tAdvanceFileOutputXML component.
Best regards
Sabrina

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To add up to my issues, I don't have the [...] button next to the loop elements in my tXMLMap (ESB 6.5.1), maybe I'm missing something because so far my XMLOuputs multiply the inputs as opposed to add them to each other. I get something like:
contrats contrat 1 roles role contrat_1_personne1 /roles support_composants support_composant product_A /support_composants /contrat contrat 1 roles role contrat_1_personne1 /roles support_composants support_composant product_B /support_composants /contrat contrat 2 roles role contrat_2_personne1 /roles support_composants support_composant product_A /support_composants /contrat ....... /contrats

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is one of my last tries...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Here is a 'append the source xml file' feature on tAdvanceFileOutputXML component.
Best regards
Sabrina

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Sabrina, tFileOutputMSXML made it... at last 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi again xdshi, thanks also for your tip: I suspect it will be the clue to finalize my "global" xml. Best regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
For merging two xml files its okay with FileOutputMSXML , but I have around 10 xml files.I would like to put all together in one xml file.As there are many loops ,which composant I can use to solve my issue?
Thanks in advance for your reply,
