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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to xpath on xml from query?

My scenario is this:

I have an sql query that extract a field that contains an xml.

I need to extract a specific value from this xml.

now the question is, how do I do this in talend?

I have tried using tJava, however the parse expects a URI and not a parameter from talend...

Labels (3)
4 Replies
iamabhishek
Creator III
Creator III

You have tXmlMap, tExtractXmlField to parse XML in Talend.

But, if you are using Sql Server (you mentioned - "I have an sql query") you will be able to perform xml parsing in database itself.

 

If you show your xml content and what exactly you are trying to achieve will help.

Anonymous
Not applicable
Author

0683p000009LyJl.png

this is my current job.

in tmap I have 20 fields. one of those fields contains an xml file.

I need to execute an xpath query on it to extract a specific tag.

question is, how do I execute xpath on a field coming from tmap? I tried using java code, but so far have been unsuccessful

iamabhishek
Creator III
Creator III

@KV - are you sure one of such field in your tMap is a XML file and not some XML data.
If it's XML data then I would recommend you to pass it through tXMLMap like this - 

0683p000009LxD1.jpgOnce the data is extracted then you could join it to tMap and perform your rest operation.

iamabhishek
Creator III
Creator III

One more way would be to use tExtractXmlField. Sample job layout defined - 

0683p000009Lypj.jpgSo, here mention the XML field and use XPath query to extract a specific tag and when done pass on the entire information to your tMap or other relevant components.