Retrieve node position in xml using TFileInputXML

Six Stars

Retrieve node position in xml using TFileInputXML

Hi,

 

I'm trying to extract some values from an xml file using a TFileInputXML component.

The xml file can contain several documents in it (from 1 to 1000 for example)

The Xpath loop query is the following one : "/Documents/Document"

 

Retrieving fields for each document is ok. But now I would like to retrieve position of each document in my xml file and store it in a field named cpt.

I've tried with the xpath function position() but it's returning an empty value.

 

In my case, the mapping is the following one :

 

Column = cpt

XPath query = "position()"

 

So can anyone can help me about the xpath query syntax ?

 

Thank you very much !

Moderator

Re: Retrieve node position in xml using TFileInputXML

Hello,

Could you please elaborate your case with an example with input and expected output values?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog