Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Vlatko
Contributor

How to extract the complete xpath for XML elements

Hi

I extract XML elements from XML files and write them to a database. I am using tXMLFileInput and tExtractXMLField components.

In both components the XPath query for each element is shown (from XML metadata) in the Mapping field.

Everything works well, but I need also the xpath itself in the output. I.e. with each XML element extracted from XML files I also need to store their complete xpath, not only the values of the elements.

How can I do that?

Best regards

Vlatko

Labels (3)
3 Replies
Anonymous
Not applicable

Hi Vlatko

I don't think the XML components can also extract the xpath. Can you show us an example to explain your requirement? We will see if any other way to extract the xpath.

 

Regards

Shong

Vlatko
Contributor
Author

Hi shong and thanks for the response!

I attach screenshots of two simple Talend jobs. Especially the first one is very simple. I have stored metadata from an XSD file in advance. The same file is then used in this job to extract the values. Of course, there is no values in an XSD file, but that's not important. The question is how to catch the XPaths from the Mapping field in the tFileInputXML component?

 

The XPaths are there in the system, but I would like to be able to catch them in the next step, in this case a tMap component.

Even if I check for "Get Nodes" and use a tXMLMap component in the next step, I cannot see the way how I could catch these XPaths, together with the values of the XML elements.

 

Best regards

Vlatko

Vlatko
Contributor
Author

And the second screenshot.