XML - Multi SUB ELMENTS

Four Stars

XML - Multi SUB ELMENTS

Hello,

i  have a problem with the component tfileoutputMSxml, i have two same sub elements and the content is different.

<cnQualBen beneficiary = "00">
<pPh lPren = "TOTO" dDNais = "1900-01-15" ccCDepNais = "95">
<name lPatName = "TITI" />
<countryNais nCountryCountry = "99100" />
<comNais lLComNais = "MAT" />
</ PPh>
<Addr>
<adrNC cnNatAdr = "01" nCPays = "99100" ccCPost = "97351" lLCom = "MAT" />
</ Addr>
<mtBenef nVal = "1" cnNatMontBenef = "1" />
</ Grantee>
or
<cnQualBen beneficiary = "00">
      <pMo IRs = "FUNNY PUMPS THE SOURCE" idPmo = "202020202" </>
        <mtBenef nVal = "2000" cnNatMontBenef = "12" />
      </ Grantee>
The problem is to guess in advance the sub elements and sometimes the part pMO is not always informed.
is there a way to tell if one of the parts is empty of no longer the output?
I am obliged to define the two sub élémént, but there is one of two sous éléménts is not values ​​to display and I do not want to make out it.
otherwise the output is:
<cnQualBen beneficiary = "00">
<pPh lPren = "TOTO" dDNais = "1900-01-15" ccCDepNais = "95">
<name lPatName = "TITI" />
<countryNais nCountryCountry = "99100" />
<comNais lLComNais = "MAT" />
</ PPh>
<Addr>
<adrNC cnNatAdr = "01" nCPays = "99100" ccCPost = "97351" lLCom = "MAT" />
</ Addr>
<PMo />
<mtBenef nVal = "1" cnNatMontBenef = "1" />
</ Grantee>

or

<cnQualBen beneficiary = "00">
<PPh>
<Name />
<PaysNais />
<ComNais />
</ PPh>
<Addr>
<AdrNC />
</ Addr>
<pMo iRs = "xxxx" idPmo = "000000" />
<mtBenef nVal = "1" cnNatMontBenef = "1" />
</ Grantee>

I want to eliminate the null part.

thanks.
Regards,

 

Bonjour,

je rencontre un problème lié au composant tfileoutputMSxml, j'ai deux mêmes sous elements et le contenu est différent.

<beneficiaire cnQualBen="00">
<pPh lPren="TOTO" dDNais="1900-01-15" ccCDepNais="95">
<nom lNomPat="TITI "/>
<paysNais nCPaysNais="99100"/>
<comNais lLComNais="MAT"/>
</pPh>
<adr>
<adrNC cnNatAdr="01" nCPays="99100" ccCPost="97351" lLCom="MAT"/>
</adr>
<mtBenef nVal="1" cnNatMontBenef="1"/>
</beneficiaire>
ou
<beneficiaire cnQualBen="00">
<pMo IRs="POMPES FUNEBRES LA SOURCE" idPmo="202020202"</>
<mtBenef nVal="2000" cnNatMontBenef="12"/>
</beneficiaire>
Le probleme il faut devinir par avance le sous elements et parfois la partie pMO n'est pas toujours renseignée.
est ce qu'il y a une methode pour dire si l'une de partie est vide de ne plus la sortie?
Je suis obligé de définir le deux sous élémént , mais il y a un de deux sous éléménts n'est pas des valeurs à afficher et je ne veux pas le faire sortir.
sinon la sortie est :
<beneficiaire cnQualBen="00">
<pPh lPren="TOTO" dDNais="1900-01-15" ccCDepNais="95">
<nom lNomPat="TITI "/>
<paysNais nCPaysNais="99100"/>
<comNais lLComNais="MAT"/>
</pPh>
<adr>
<adrNC cnNatAdr="01" nCPays="99100" ccCPost="97351" lLCom="MAT"/>
</adr>
<pMo/>
<mtBenef nVal="1" cnNatMontBenef="1"/>
</beneficiaire>

ou

<beneficiaire cnQualBen="00">
<pPh>
<nom/>
<paysNais/>
<comNais/>
</pPh>
<adr>
<adrNC/>
</adr>
<pMo iRs="xxxx" idPmo="000000"/>
<mtBenef nVal="1" cnNatMontBenef="1"/>
</beneficiaire>

je veux éliminer la partie null.
Cordialement,

 

 

 

 

Tags (1)
Moderator

Re: XML - Multi SUB ELMENTS

Hello,

Do you want to combine your Multi SUB ELMENTS of xml file into one? Could you provide us (in your example) with the expected output file?

Best regards

Sabrina

 

 

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now