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...
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.
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
@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 -
Once the data is extracted then you could join it to tMap and perform your rest operation.
One more way would be to use tExtractXmlField. Sample job layout defined -
So, 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.