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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Talend's FileInputXML and Xpath 2.0

Hey folks,
I'm trying to parse a xml input file via the FileInputXML component. However, my Xpath 2.0 expression (tested in XMLSpy) will not work in Talend:
- The xpath is as follows in XML Spy:
(if(exists(//data/invoice)) then (//data/invoice) else (//data/invoice))
- The xpath is as follows in Talend (escaped cause its a String in Talend):
"(if(exists(//data/invoice)) then (//data/invoice) else (//data/invoice))"
The exception I get indicates (imho) a mismatch between the component and xpath 2.0. So my question is a) does de component actually support xpath 2.0 and b1) if not, is there a viable alternative or b2) it does, what am I doing wrong?
I've added 2 example input xml files and the expected result in pseudo xml to indicate what I'm trying to achieve:
- In the non YK file there are multiple invoice elements, none of them with an object-id that starts with YK. So I expect Talend to loop over each invoice element.
- In the YK file there are also multiple invoice elements, but one of them has an object-id that starts with YK. So I expect Talend to only that specific invoice element.
The Talend exception: javax.xml.transform.TransformerException: Could not find function: if
at com.sun.org.apache.xpath.internal.compiler.XPathParser.error
I hope I explained it enough and thanks in advance for the help.
Regards Roel
Labels (4)
2 Replies
Anonymous
Not applicable
Author

Hello
Talend doesn't support a xpath as you set, for now, you can set the xpath as below, extract all the records and filter the records on tMap
/root/body/data/invoice
Best regards

shong
Anonymous
Not applicable
Author

Maybe you can request for this feature in the bug tracker, it would need to use the library saxon (for instance) for parsing.