Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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)
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
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.