How to read value in complex xml file

Four Stars

How to read value in complex xml file

Hello,

Somebody can help me on how to read value in complex xml file.

See screen short and sample of xml file that a try to read value.

 

 

Best regard

Four Stars

Re: How to read value in complex xml file

This is a sample of xml file.

Thanks

Community Manager

Re: How to read value in complex xml file

The best way to do this is to use a tFileInputXML and Xpath expressions. You can find information on the tFileInputXML component here (https://help.talend.com/reader/iYcvdknuprDzYycT3WRU8w/dQGBQzM08Kw9ML1iG_Ge5g).

 

A good online tool for checking and perfecting your XPaths can be found here (https://www.freeformatter.com/xpath-tester.html)

Highlighted
Forteen Stars

Re: How to read value in complex xml file

in addition to @rhall_2_0 

 

a lot of time and emotions save a proper XML/JSON tools, like OxygenXML (Altova, LiquidXML) they not only allow to test XPath but also show to you XPath on the selected place in the file

 

Screen Shot 2019-04-19 at 1.55.05 AM.png

 

 

-----------
Nine Stars

Re: How to read value in complex xml file

Hi,

You'll also need to implement the query aspect of parsing through the XML. So, in your example screen shot, to acquire the Job_Profile_ID you'll need to use something like:

 

"/wd:Report_Data/wd:Report_Entry/wd: Position_group/wd:Job_Profile/wd:ID[@wd:type='Job_Profile_ID']"

 

As the Loop XPath query, to only bring back the element where the wd:type is of the type you're looking for. Workday is a notoriously complex XML structure and you may find you have to query into the same file multiple times to pull out all of the values you're after.

Regards David
Dont forget to give Kudos when an answer is helpful or mark the answer as the solution.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch