XML file read in talend

Six Stars PK
Six Stars

XML file read in talend

Hi All,

I am trying to read below xml file in talend, but looks like it does not support format.

 

<sup:SupplierSubscriptionEvent xmlns:sup="http://supplier.subscription.partyconnec.com" xmlns:com="http://common.subscription.partyconnect.ge.com" xmlns:par="http://party.subscription.partyconnect.ge.com"> <com:schemaVersion>1.0-rc14</com:schemaVersion> <com:messageId>1111-1111-1111</com:messageId> <com:transactionId>2222-2222-2222</com:transactionId> <com:subsciptionId>11111</com:subsciptionId> <com:eventType>CREATE</com:eventType> <com:updatedBySso>502456517</com:updatedBySso> <!--1 or more repetitions:--> <com:downstreamSystem> <com:tier1>Transportation</com:tier1> <com:tier2>Transportation</com:tier2> <com:tier3>United Kingdom</com:tier3> <com:erpInstance>GET</com:erpInstance> <com:orgId>2329</com:orgId> <com:orgName>GETSUK</com:orgName> </com:downstreamSystem> <sup:dataDelta id="S00001" action="CREATE"> <com:version>1</com:version> <com:active>true</com:active> <!-- need to add blocking reason code --> <com:inactiveReason></com:inactiveReason> <par:countryCode>US</par:countryCode> <par:legalName>GENERAL ELECTRIC COMPANY</par:legalName> <par:legalNameTranslated>bla-bla</par:legalNameTranslated> <par:alternativeName>GE</par:alternativeName> <par:registrationId>111/111/111</par:registrationId> <par:alternateIds> <!--Zero or more repetitions:--> <com:alternateId value="123456" type="GSL6" active="true"/> </par:alternateIds> <par:diversities apply="true"> <!--Zero or more repetitions:--> <par:diversity type="ALASKA_NATIVE_CORP" apply="false"/> <par:diversity type="BLACK_OWNED" apply="false"/> <par:diversity type="HISTORICALY_BLACK_CUMI" apply="false"/> <par:diversity type="HUB_ZONE_B" apply="false"/> <par:diversity type="LGBT_BE" apply="false"/> <par:diversity type="MINORITY_BE" apply="false"/> <par:diversity type="SERVICE_DISABLED_VETERAN_OWNED_SB" apply="false"/> <par:diversity type="DISADVANTAGED_SB" apply="false"/> <par:diversity type="WOMEN_OWNED_SB" apply="false"/> <par:diversity type="VETERAN_OWNED_SB" apply="false"/> </par:diversities> <!--Zero or more repetitions:--> <par:address id="S00001001" action="CREATE"> <com:version>1</com:version> <com:active>true</com:active> <com:inactiveReason></com:inactiveReason> <par:siteId>101</par:siteId> <par:addressType>ORDER_FULFILLMENT</par:addressType> <par:alternateName>Fairfield spot</par:alternateName> <par:location> <par:countryCode>US</par:countryCode> <par:stateCode>CT</par:stateCode> <par:stateName>CONNECTICUT</par:stateName> <par:provinceName></par:provinceName> <par:countyName></par:countyName> <par:cityName>FAIRFIELD</par:cityName> <par:postalCode>06828-0001</par:postalCode> <par:addressLine1>3135 EASTON TPKE</par:addressLine1> <par:addressLine2></par:addressLine2> <par:addressLine3></par:addressLine3> <par:addressLine4></par:addressLine4> <par:poBoxNumber></par:poBoxNumber> </par:location> <par:emailForPurchaseOrders>po@ge.com</par:emailForPurchaseOrders> <par:emailForRemittance>remittance@ge.com</par:emailForRemittance> <par:watchlistScreeningStatus>PASS</par:watchlistScreeningStatus> <par:alternateIds> <!--Zero or more repetitions:--> <com:alternateId value="123456-001" type="GSL9" active="true"/> </par:alternateIds> <!--Zero or more repetitions:--> <par:bankAccount id="BA-0000-0000-0000-0001" action="CREATE"> <com:version>1</com:version> <com:active>true</com:active> <par:partyAccountName>TATA America International Corporation</par:partyAccountName> <par:partyAccountNameTranslated>TATA America International Corporation</par:partyAccountNameTranslated> <par:partyBankInfo> <par:bankName>BNP PARIBAS IP BELGIUM SA</par:bankName> <par:bankNameTranslated>BNP PARIBAS IP BELGIUM SA</par:bankNameTranslated> <par:branchName></par:branchName> <par:branchNameTranslated></par:branchNameTranslated> <par:bankRoutingNumber>111111</par:bankRoutingNumber> <par:accountNumber>222222</par:accountNumber> <par:accountCurrencyCode>EUR</par:accountCurrencyCode> <par:iban>FIMGBEBB</par:iban> <par:swift>FIMGBEBBXXX</par:swift> <par:bankAddress> <par:countryCode>BL</par:countryCode> <par:stateCode></par:stateCode> <par:stateName></par:stateName> <par:provinceName></par:provinceName> <par:countyName></par:countyName> <par:cityName>BRUSSELS</par:cityName> <par:postalCode>1210</par:postalCode> <par:addressLine1>AVENUE DU PROGRES 55</par:addressLine1> <par:addressLine2></par:addressLine2> <par:addressLine3></par:addressLine3> <par:addressLine4></par:addressLine4> </par:bankAddress> <par:watchlistScreeningStatus>PASS</par:watchlistScreeningStatus> </par:partyBankInfo> <par:useIntermediaryBank>true</par:useIntermediaryBank> <par:intermediaryBankInfo> <!-- same structure as partyBankInfo --> </par:intermediaryBankInfo> <par:useFurtherCreditTo>true</par:useFurtherCreditTo> <par:furtherCreditTo> <par:bankName>NATIONAL BANK OF ANGUILLA LTD.</par:bankName> <par:accountNumber>999999</par:accountNumber> <par:beneficiaryName>Mr X</par:beneficiaryName> </par:furtherCreditTo> <par:primaryFlag>true</par:primaryFlag> </par:bankAccount> <par:bankAccount id="BA-0000-0000-0000-0002" action="CREATE"> <com:version>1</com:version> <com:active>true</com:active> <par:partyAccountName>TATA America International Corporation</par:partyAccountName> <par:partyAccountNameTranslated>TATA America International Corporation</par:partyAccountNameTranslated> <par:partyBankInfo> <par:bankName>BNP PARIBAS IP BELGIUM SA</par:bankName> <par:bankNameTranslated>BNP PARIBAS IP BELGIUM SA</par:bankNameTranslated> <par:branchName></par:branchName> <par:branchNameTranslated></par:branchNameTranslated> <par:bankRoutingNumber>111111</par:bankRoutingNumber> <par:accountNumber>222222</par:accountNumber> <par:accountCurrencyCode>EUR</par:accountCurrencyCode> <par:iban>FIMGBEBB</par:iban> <par:swift>FIMGBEBBXXX</par:swift> <par:bankAddress> <par:countryCode>BL</par:countryCode> <par:stateCode></par:stateCode> <par:stateName></par:stateName> <par:provinceName></par:provinceName> <par:cityName>BRUSSELS</par:cityName> <par:postalCode>1210</par:postalCode> <par:addressLine1>AVENUE DU PROGRES 55</par:addressLine1> <par:addressLine2></par:addressLine2> <par:addressLine3></par:addressLine3> <par:addressLine4></par:addressLine4> </par:bankAddress> <par:watchlistScreeningStatus>PASS</par:watchlistScreeningStatus> </par:partyBankInfo> <par:useIntermediaryBank>true</par:useIntermediaryBank> <par:intermediaryBankInfo> <!-- same structure as partyBankInfo --> </par:intermediaryBankInfo> <par:useFurtherCreditTo>true</par:useFurtherCreditTo> <par:furtherCreditTo> <par:bankName>NATIONAL BANK OF ANGUILLA LTD.</par:bankName> <par:accountNumber>999999</par:accountNumber> <par:beneficiaryName>Mr X</par:beneficiaryName> </par:furtherCreditTo> <par:primaryFlag>false</par:primaryFlag> </par:bankAccount> <!--Zero or more repetitions:--> <par:contact id="CO-0000-0000-0000-0001" action="CREATE"> <com:version>1</com:version> <com:active>true</com:active> <par:contactType>REMITTANCE</par:contactType> <par:firstName>Michael</par:firstName> <par:lastName>Yashin</par:lastName> <par:email>michael.yashin@ge.com</par:email> <par:businessPhoneCountryPrefix>1</par:businessPhoneCountryPrefix> <par:businessPhoneNumber>555-555-5555</par:businessPhoneNumber> <par:mobilePhoneCountryPrefix>1</par:mobilePhoneCountryPrefix> <par:mobilePhoneNumber>555-555-5555</par:mobilePhoneNumber> <par:preferredContact>BUSINESS_PHONE</par:preferredContact> <par:watchlistScreeningStatus>PASS</par:watchlistScreeningStatus> </par:contact> <par:contact id="CO-0000-0000-0000-0002" action="CREATE"> <com:version>1</com:version> <com:active>true</com:active> <par:contactType>SALES</par:contactType> <par:firstName>Anton</par:firstName> <par:lastName>Abramkin</par:lastName> <par:email>anton.abramkin@ge.com</par:email> <par:businessPhoneCountryPrefix>1</par:businessPhoneCountryPrefix> <par:businessPhoneNumber>555-555-5555</par:businessPhoneNumber> <par:mobilePhoneCountryPrefix>1</par:mobilePhoneCountryPrefix> <par:mobilePhoneNumber>555-555-5555</par:mobilePhoneNumber> <par:preferredContact>BUSINESS_PHONE</par:preferredContact> <par:watchlistScreeningStatus>PASS</par:watchlistScreeningStatus> </par:contact> </par:address> <sup:group id="GE" name="General Electric Corporation"/> <sup:commodityTier1>Utilities</sup:commodityTier1> <sup:commodityTier2>Electricity</sup:commodityTier2> <sup:commodityTier3>Electric utilities</sup:commodityTier3> <sup:supplierSpeciality>MANUFACTURER</sup:supplierSpeciality> <sup:legalTax> <sup:taxClassification>Non Profit Organizaiton</sup:taxClassification> <sup:taxIdentificationNumber>444-44-4444</sup:taxIdentificationNumber> <sup:exemptFromWithholdingTax>true</sup:exemptFromWithholdingTax> </sup:legalTax> <sup:crossBorderTaxes> <!--Zero or more repetitions:--> <sup:crossBorderTax> <sup:countryCode>IT</sup:countryCode> <sup:providedProduct>Services</sup:providedProduct> <sup:taxRegistrationNumber>3333/333/3333</sup:taxRegistrationNumber> <sup:exemptFromWithholdingTax>true</sup:exemptFromWithholdingTax> </sup:crossBorderTax> </sup:crossBorderTaxes> <sup:vats> <!--Zero or more repetitions:--> <sup:vat> <sup:countryCode>IT</sup:countryCode> <sup:taxAuthority>Imposta sul Valore Aggiunto</sup:taxAuthority> <sup:taxRegistrationNumber>aaa-bbb-ccc</sup:taxRegistrationNumber> </sup:vat> </sup:vats> <!-- OU/ERP/Subscription-custom level data: START --> <sup:paymentTerm> <sup:name>2.5%-2%-1.5% Disc. 10-20-30 Days, Net 60</sup:name> <sup:description>2.5%, 2%, 1.5% Discount if paid by Day 10, 20, 30 respectively, else total amount due on Day 60</sup:description> <sup:type>Multi Tier</sup:type> <sup:discount1 percent="2.5" days="10"/> <sup:discount2 percent="2" days="20"/> <sup:discount3 percent="1.5" days="30"/> <sup:netDays>60</sup:netDays> <sup:paymentFrequency></sup:paymentFrequency> <sup:dueDayOfMonth></sup:dueDayOfMonth> <sup:dueMonthsForward></sup:dueMonthsForward> </sup:paymentTerm> <sup:incoTerm>CFR</sup:incoTerm> <sup:settlementProcess>EPCARD</sup:settlementProcess> <sup:customPaymentProcesses> <sup:customPaymentProcess>Payment Request</sup:customPaymentProcess> </sup:customPaymentProcesses> <!-- OU/ERP/Subscription-custom level data: END --> <sup:aspFlag>true</sup:aspFlag> <sup:aspFunction>Environmental</sup:aspFunction> <sup:directFlag>true</sup:directFlag> </sup:dataDelta> <!-- Snapshot not required on supplier create event --> <!--<sup:dataSnapshot>--> <!--</sup:dataSnapshot>--> </sup:SupplierSubscriptionEvent>

Can anyone help me with this requirement.

 

Regards

PK

Tags (1)
Seven Stars

Re: XML file read in talend

Hi,

Can you tell me whether you saved these data into file or you extracting it from url?

Tell us your complete workflow.

Six Stars PK
Six Stars

Re: XML file read in talend

Hi,

 

I got this data in filename.xml and my requirement is to read the data from xml file and load into postgresql.

 

I tried to read the xml file using metadata->file xml but getting an error like "xml is not in correct format".

 

Seven Stars

Re: XML file read in talend

Hi Pk,

some data is missing from the file.

error1.PNG

you are missing the xmlns:com link which is related to the data presented in your file.

 

say for an example : 

please look at the image below

error2.PNG

you are missing the link for  "par: " element.

 

Hope this helps you!

Seven Stars

Re: XML file read in talend

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

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