[resolved] Loop XPath Query Issue in tFileInpuutXML

Highlighted
One Star

[resolved] Loop XPath Query Issue in tFileInpuutXML

Hello,

I have an xml file I need to parse. I need to loop on the following data in the xml file:

"/reporting:root/reportingSmiley Tongueositions1/reporting:window/reporting:folio"
"/reporting:root/reportingSmiley Tongueositions2/reporting:window/reporting:folio"
"/reporting:root/reportingSmiley Tongueositions3/reporting:window/reporting:folio"


"/reporting:root/reporting:instruments/reporting:window/reporting:folio"


The first 3 xpath queries contain the same underlying data, so I can use the following Loop Xpath query:

"/reporting:root/*/reporting:window/reporting:folio"

to collect the position related data in one hit.


However, the wildcard will match to: "/reporting:root/reporting:instruments/reporting:window/reporting:folio", which is what I don't want to happen.

Is there any way I can prevent the instrument childern being iterated ?

I have tried a pattern like:

"/reporting:root/reportingSmiley Tongueositions*/reporting:window/reporting:folio", but this does not work.

Any suggestions greatly appricated.

Thanks
Highlighted
One Star

Re: [resolved] Loop XPath Query Issue in tFileInpuutXML

what about
*[starts-with(name(),'position')]
Highlighted
One Star

Re: [resolved] Loop XPath Query Issue in tFileInpuutXML

Thank you VERY much. That precisely solves my problem.

2019 GARTNER 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

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

Downloads and Trials

Test drive Talend's enterprise products.

Downloads