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

Parsing an XML file with XPath Query

Hi everyone,
I would like to know if in a component like tFileInputXML, we can use a XPath Query like   //something   (for selecting all the element called something in a XML Document) or like   /folder1/something | /folder2/something    (for selecting elements called something in folder1 AND folder2) ???
Sources :  on chapter Selecting Unknown Nodes and Selecting Several Paths
Thanks for your help !
Labels (3)
4 Replies
Anonymous
Not applicable
Author

hi,
you can use any filter or xpath queries, if you 're using dom4j mode (load entire document in memory).
possible also with textractxmlfield as it switch automaticaly in dom4j mode.
As it load the entire document, JVM need a lot of allocated memories to work with huge xml  0683p000009MA9p.png
regards
laurent
Anonymous
Not applicable
Author

Thnx for your response,
How can I activate this mode ? I'm not sure that I should use it because I have to parse a really fat XML file provided by a webservice (came from an URI)...
The real problem is that I have to pick up a data present in different loop.
Exemple : 
I need to collect all the birthdate of everyone :
--------------------------------------------------------------------------
<Family>
<Father>
<Firstname>Charles</ Firstname >
<Birthdate >16/04/1962</Birthdate >
</ Father >
<Mother>
< Firstname >Marie</ Firstname >
<Birthdate >12/11/1963</Birthdate >
</ Mother >
<Children>
< Child >
< Firstname >Nicolas</ Firstname >
<Birthdate >22/03/1995</Birthdate >
</ Child >
< Child >
< Firstname >Thomas</ Firstname >
<Birthdate >01/02/1992</Birthdate >
</ Child >
</ Children >
</ Family >
--------------------------------------------------------------------------
So I would use a XPath Query like //Birthdate or / Father/Birthdate | / Mother/Birthdate but it doesn't seems to work...

My process :
tHttpRequest--tExtractXMLField--tMap--tPostgresOutput
Anonymous
Not applicable
Author

look for mode in advanced setting of component :
0683p000009MCzZ.png
tExtractXMLField => dom4j is automatic.
Anonymous
Not applicable
Author

oh...ok I was using it already...
So why the XPath Queries "//Birthdate" or "/Father/Birthdate | /Mother/Birthdate" doesn't work ?
Is it a bug ? A bad syntax ? Or maybe Talend doesn't works with every kind of XPath Queries ?
Thanks for your answer !
---EDIT---
Source : wwww3schoolscom/xpath/xpath_syntaxasp