Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Labels (3)
4 Replies
Anonymous
Not applicable
Author

This is a sample of xml file.

Thanks


InputXML.xml
Anonymous
Not applicable
Author

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)

vapukov
Master II
Master II

in addition to @rhall 

 

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

 

0683p000009M4hb.png

 

 

David_Beaty
Specialist
Specialist

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.